1
0
Fork 0

refactor(rancher): headers as pointer.

This commit is contained in:
Fernandez Ludovic 2018-01-02 16:10:37 +01:00 committed by Traefiker
parent 38b5aef208
commit 7e5c258266
2 changed files with 42 additions and 89 deletions

View file

@ -55,45 +55,29 @@ func (p *Provider) buildConfiguration(services []rancherData) *types.Configurati
"getRateLimitsExtractorFunc": getFuncString(label.TraefikFrontendRateLimitExtractorFunc, ""),
"getRateLimits": getRateLimits,
// Headers
"hasHeaders": hasPrefixFunc(label.TraefikFrontendHeaders),
"hasRequestHeaders": hasFunc(label.TraefikFrontendRequestHeaders),
"getRequestHeaders": getFuncMap(label.TraefikFrontendRequestHeaders),
"hasResponseHeaders": hasFunc(label.TraefikFrontendResponseHeaders),
"getResponseHeaders": getFuncMap(label.TraefikFrontendResponseHeaders),
"hasAllowedHostsHeaders": hasFunc(label.TraefikFrontendAllowedHosts),
"getAllowedHostsHeaders": getFuncSliceString(label.TraefikFrontendAllowedHosts),
"hasHostsProxyHeaders": hasFunc(label.TraefikFrontendHostsProxyHeaders),
"getHostsProxyHeaders": getFuncSliceString(label.TraefikFrontendHostsProxyHeaders),
"hasSSLRedirectHeaders": hasFunc(label.TraefikFrontendSSLRedirect),
"getSSLRedirectHeaders": getFuncBool(label.TraefikFrontendSSLRedirect, false),
"hasSSLTemporaryRedirectHeaders": hasFunc(label.TraefikFrontendSSLTemporaryRedirect),
"getSSLTemporaryRedirectHeaders": getFuncBool(label.TraefikFrontendSSLTemporaryRedirect, false),
"hasSSLHostHeaders": hasFunc(label.TraefikFrontendSSLHost),
"getSSLHostHeaders": getFuncString(label.TraefikFrontendSSLHost, ""),
"hasSSLProxyHeaders": hasFunc(label.TraefikFrontendSSLProxyHeaders),
"getSSLProxyHeaders": getFuncMap(label.TraefikFrontendSSLProxyHeaders),
"hasSTSSecondsHeaders": hasFunc(label.TraefikFrontendSTSSeconds),
"getSTSSecondsHeaders": getFuncInt64(label.TraefikFrontendSTSSeconds, 0),
"hasSTSIncludeSubdomainsHeaders": hasFunc(label.TraefikFrontendSTSIncludeSubdomains),
"getSTSIncludeSubdomainsHeaders": getFuncBool(label.TraefikFrontendSTSIncludeSubdomains, false),
"hasSTSPreloadHeaders": hasFunc(label.TraefikFrontendSTSPreload),
"getSTSPreloadHeaders": getFuncBool(label.TraefikFrontendSTSPreload, false),
"hasForceSTSHeaderHeaders": hasFunc(label.TraefikFrontendForceSTSHeader),
"getForceSTSHeaderHeaders": getFuncBool(label.TraefikFrontendForceSTSHeader, false),
"hasFrameDenyHeaders": hasFunc(label.TraefikFrontendFrameDeny),
"getFrameDenyHeaders": getFuncBool(label.TraefikFrontendFrameDeny, false),
"hasCustomFrameOptionsValueHeaders": hasFunc(label.TraefikFrontendCustomFrameOptionsValue),
"getCustomFrameOptionsValueHeaders": getFuncString(label.TraefikFrontendCustomFrameOptionsValue, ""),
"hasContentTypeNosniffHeaders": hasFunc(label.TraefikFrontendContentTypeNosniff),
"getContentTypeNosniffHeaders": getFuncBool(label.TraefikFrontendContentTypeNosniff, false),
"hasBrowserXSSFilterHeaders": hasFunc(label.TraefikFrontendBrowserXSSFilter),
"getBrowserXSSFilterHeaders": getFuncBool(label.TraefikFrontendBrowserXSSFilter, false),
"hasContentSecurityPolicyHeaders": hasFunc(label.TraefikFrontendContentSecurityPolicy),
"getContentSecurityPolicyHeaders": getFuncString(label.TraefikFrontendContentSecurityPolicy, ""),
"hasPublicKeyHeaders": hasFunc(label.TraefikFrontendPublicKey),
"getPublicKeyHeaders": getFuncString(label.TraefikFrontendPublicKey, ""),
"hasReferrerPolicyHeaders": hasFunc(label.TraefikFrontendReferrerPolicy),
"getReferrerPolicyHeaders": getFuncString(label.TraefikFrontendReferrerPolicy, ""),
"hasIsDevelopmentHeaders": hasFunc(label.TraefikFrontendIsDevelopment),
"getIsDevelopmentHeaders": getFuncBool(label.TraefikFrontendIsDevelopment, false),
}