Skip to content

Commit

Permalink
Merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
p53 committed Nov 22, 2024
2 parents df9db74 + 7ff5ae3 commit 6cf1aea
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions pkg/testsuite/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1611,6 +1611,43 @@ func TestXForwarded(t *testing.T) {
},
},
},
{
Name: "TestEmptyXForwardedHost",
ProxySettings: func(_ *config.Config) {
},
ExecutionSettings: []fakeRequest{
{
URI: FakeAuthAllURL + FakeTestURL,
HasToken: true,
ExpectedProxy: true,
ExpectedProxyHeadersValidator: map[string]func(*testing.T, *config.Config, string){
"X-Forwarded-Host": func(t *testing.T, _ *config.Config, value string) {
assert.Contains(t, value, "127.0.0.1")
},
},
ExpectedCode: http.StatusOK,
},
},
},
{
Name: "TestXForwardedHostPresent",
ProxySettings: func(_ *config.Config) {
},
ExecutionSettings: []fakeRequest{
{
URI: FakeAuthAllURL + FakeTestURL,
HasToken: true,
ExpectedProxy: true,
Headers: map[string]string{
"X-Forwarded-Host": "189.10.10.1",
},
ExpectedProxyHeaders: map[string]string{
"X-Forwarded-Host": "189.10.10.1",
},
ExpectedCode: http.StatusOK,
},
},
},
}

for _, testCase := range testCases {
Expand Down

0 comments on commit 6cf1aea

Please sign in to comment.