Replace request_uri

This commit is contained in:
Manuel Alejandro de Brito Fontes 2020-09-27 20:26:39 -03:00
parent 108637bb1c
commit 493dd6726d
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
6 changed files with 31 additions and 16 deletions

View file

@ -196,7 +196,7 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
// we can not use gorequest here because it flattens the duplicate headers
// and specifically in case of Strict-Transport-Security it ignore extra headers
// intead of concatenating, rightfully. And I don't know of any API it provides for getting raw headers.
curlCmd := fmt.Sprintf("curl -I -k --fail --silent --resolve settings-tls:443:127.0.0.1 https://settings-tls/%v", "?hsts=true")
curlCmd := fmt.Sprintf("curl -I -k --fail --silent --resolve settings-tls:443:127.0.0.1 https://settings-tls%v", "?hsts=true")
output, err := f.ExecIngressPod(curlCmd)
assert.Nil(ginkgo.GinkgoT(), err)
assert.Contains(ginkgo.GinkgoT(), output, "strict-transport-security: max-age=86400; preload")
@ -222,7 +222,7 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
WithHeader("Host", host).
Expect().
Status(http.StatusPermanentRedirect).
Header("Location").Equal(fmt.Sprintf("https://%v/", host))
Header("Location").Equal(fmt.Sprintf("https://%v", host))
})
ginkgo.It("should not use ports or X-Forwarded-Host during the HTTP to HTTPS redirection", func() {
@ -243,7 +243,7 @@ var _ = framework.DescribeSetting("[SSL] TLS protocols, ciphers and headers)", f
WithHeader("X-Forwarded-Host", "example.com:80").
Expect().
Status(http.StatusPermanentRedirect).
Header("Location").Equal("https://example.com/")
Header("Location").Equal("https://example.com")
})
})