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

@ -46,6 +46,6 @@ var _ = framework.DescribeAnnotation("force-ssl-redirect", func() {
WithHeader("Host", host).
Expect().
Status(http.StatusPermanentRedirect).
Header("Location").Equal("https://forcesslredirect.bar.com/")
Header("Location").Equal("https://forcesslredirect.bar.com")
})
})

View file

@ -49,7 +49,7 @@ var _ = framework.DescribeAnnotation("from-to-www-redirect", func() {
f.WaitForNginxConfiguration(
func(cfg string) bool {
return strings.Contains(cfg, `server_name www.fromtowwwredirect.bar.com;`) &&
strings.Contains(cfg, `return 308 $scheme://fromtowwwredirect.bar.com$request_uri;`)
strings.Contains(cfg, `return 308 $redirect_to;`)
})
ginkgo.By("sending request to www.fromtowwwredirect.bar.com")
@ -85,7 +85,7 @@ var _ = framework.DescribeAnnotation("from-to-www-redirect", func() {
f.WaitForNginxServer(toHost,
func(server string) bool {
return strings.Contains(server, fmt.Sprintf(`server_name %v;`, toHost)) &&
strings.Contains(server, fmt.Sprintf(`return 308 $scheme://%v$request_uri;`, fromHost))
strings.Contains(server, `return 308 $redirect_to;`)
})
ginkgo.By("sending request to www should redirect to domain")
@ -98,7 +98,7 @@ var _ = framework.DescribeAnnotation("from-to-www-redirect", func() {
WithHeader("Host", toHost).
Expect().
Status(http.StatusPermanentRedirect).
Header("Location").Equal(fmt.Sprintf("https://%v/", fromHost))
Header("Location").Equal(fmt.Sprintf("https://%v", fromHost))
ginkgo.By("sending request to domain should not redirect to www")
f.HTTPTestClientWithTLSConfig(&tls.Config{