1
0
Fork 0

Add SSLForceHost support.

This commit is contained in:
Ludovic Fernandez 2018-05-14 11:44:03 +02:00 committed by Traefiker Bot
parent dce65ab9c2
commit b7d20496f3
37 changed files with 389 additions and 40 deletions

View file

@ -53,6 +53,7 @@ const (
pathFrontendCustomResponseHeaders = "/headers/customresponseheaders/"
pathFrontendAllowedHosts = "/headers/allowedhosts"
pathFrontendHostsProxyHeaders = "/headers/hostsproxyheaders"
pathFrontendSSLForceHost = "/headers/sslforcehost"
pathFrontendSSLRedirect = "/headers/sslredirect"
pathFrontendSSLTemporaryRedirect = "/headers/ssltemporaryredirect"
pathFrontendSSLHost = "/headers/sslhost"

View file

@ -226,6 +226,7 @@ func (p *Provider) getHeaders(rootPath string) *types.Headers {
SSLProxyHeaders: p.getMap(rootPath, pathFrontendSSLProxyHeaders),
AllowedHosts: p.getList("", rootPath, pathFrontendAllowedHosts),
HostsProxyHeaders: p.getList(rootPath, pathFrontendHostsProxyHeaders),
SSLForceHost: p.getBool(false, rootPath, pathFrontendSSLForceHost),
SSLRedirect: p.getBool(false, rootPath, pathFrontendSSLRedirect),
SSLTemporaryRedirect: p.getBool(false, rootPath, pathFrontendSSLTemporaryRedirect),
SSLHost: p.get("", rootPath, pathFrontendSSLHost),

View file

@ -121,6 +121,7 @@ func TestProviderBuildConfiguration(t *testing.T) {
withPair(pathFrontendPublicKey, "foo"),
withPair(pathFrontendReferrerPolicy, "foo"),
withPair(pathFrontendCustomBrowserXSSValue, "foo"),
withPair(pathFrontendSSLForceHost, "true"),
withPair(pathFrontendSSLRedirect, "true"),
withPair(pathFrontendSSLTemporaryRedirect, "true"),
withPair(pathFrontendSTSIncludeSubdomains, "true"),
@ -254,6 +255,7 @@ func TestProviderBuildConfiguration(t *testing.T) {
PublicKey: "foo",
ReferrerPolicy: "foo",
CustomBrowserXSSValue: "foo",
SSLForceHost: true,
SSLRedirect: true,
SSLTemporaryRedirect: true,
STSIncludeSubdomains: true,