Allow multiple secure middlewares to operate independently
This commit is contained in:
parent
cb1d0441e9
commit
73513f8371
7 changed files with 99 additions and 11 deletions
|
@ -8,7 +8,7 @@ import (
|
|||
"github.com/unrolled/secure"
|
||||
)
|
||||
|
||||
func buildHeaders(hdrs *dynamic.Headers) func(*http.Response) error {
|
||||
func buildHeaders(hdrs *dynamic.Headers, contextKey string) func(*http.Response) error {
|
||||
opt := secure.Options{
|
||||
BrowserXssFilter: hdrs.BrowserXSSFilter,
|
||||
ContentTypeNosniff: hdrs.ContentTypeNosniff,
|
||||
|
@ -31,6 +31,7 @@ func buildHeaders(hdrs *dynamic.Headers) func(*http.Response) error {
|
|||
SSLProxyHeaders: hdrs.SSLProxyHeaders,
|
||||
STSSeconds: hdrs.STSSeconds,
|
||||
FeaturePolicy: hdrs.FeaturePolicy,
|
||||
SecureContextKey: contextKey,
|
||||
}
|
||||
|
||||
return func(resp *http.Response) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue