Fix custom headers template

This commit is contained in:
Ludovic Fernandez 2018-01-02 10:10:04 +01:00 committed by Traefiker
parent 75533b2beb
commit bfd142b13b
11 changed files with 151 additions and 96 deletions

View file

@ -6,7 +6,11 @@ import (
)
// NewSecure constructs a new Secure instance with supplied options.
func NewSecure(headers types.Headers) *secure.Secure {
func NewSecure(headers *types.Headers) *secure.Secure {
if headers == nil || !headers.HasSecureHeadersDefined() {
return nil
}
opt := secure.Options{
AllowedHosts: headers.AllowedHosts,
HostsProxyHeaders: headers.HostsProxyHeaders,