github.com/jxgolibs/go-oauth2-server@v1.0.1/util/secure.go (about)

     1  package util
     2  
     3  import (
     4  	"github.com/unrolled/secure"
     5  )
     6  
     7  // NewSecure returns instance of secure.Secure to redirect http to https
     8  func NewSecure(isDevelopment bool) *secure.Secure {
     9  	return secure.New(secure.Options{
    10  		SSLRedirect:     true,
    11  		SSLProxyHeaders: map[string]string{"X-Forwarded-Proto": "https"},
    12  		IsDevelopment:   isDevelopment,
    13  	})
    14  }