forked from TrueCloudLab/distribution
Add test for precendence with standard port
Signed-off-by: Troels Thomsen <troels@thomsen.io> Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
08b06dc023
commit
d4c3e88426
1 changed files with 16 additions and 0 deletions
|
@ -264,6 +264,22 @@ func TestBuilderFromRequest(t *testing.T) {
|
||||||
}},
|
}},
|
||||||
base: "http://example.com:443",
|
base: "http://example.com:443",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "forwarded standard port with non-standard headers",
|
||||||
|
request: &http.Request{URL: u, Host: u.Host, Header: http.Header{
|
||||||
|
"X-Forwarded-Proto": []string{"https"},
|
||||||
|
"X-Forwarded-Port": []string{"443"},
|
||||||
|
}},
|
||||||
|
base: "https://example.com",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "forwarded standard port with non-standard headers and explicit port",
|
||||||
|
request: &http.Request{URL: u, Host: u.Host + ":443", Header: http.Header{
|
||||||
|
"X-Forwarded-Proto": []string{"https"},
|
||||||
|
"X-Forwarded-Port": []string{"443"},
|
||||||
|
}},
|
||||||
|
base: "https://example.com:443",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "several non-standard headers",
|
name: "several non-standard headers",
|
||||||
request: &http.Request{URL: u, Host: u.Host, Header: http.Header{
|
request: &http.Request{URL: u, Host: u.Host, Header: http.Header{
|
||||||
|
|
Loading…
Reference in a new issue