|
|
|
@ -192,20 +192,20 @@ func TestExtractHostHeader(t *testing.T) { |
|
|
|
expected: "[::1]:8080", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "IPv6 address without brackets and standard port, should return bracketed IPv6", |
|
|
|
name: "IPv6 address without brackets and standard port, should strip brackets per AWS SDK", |
|
|
|
hostHeader: "backend:8333", |
|
|
|
forwardedHost: "::1", |
|
|
|
forwardedPort: "80", |
|
|
|
forwardedProto: "http", |
|
|
|
expected: "[::1]", |
|
|
|
expected: "::1", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "IPv6 address without brackets and standard HTTPS port, should return bracketed IPv6", |
|
|
|
name: "IPv6 address without brackets and standard HTTPS port, should strip brackets per AWS SDK", |
|
|
|
hostHeader: "backend:8333", |
|
|
|
forwardedHost: "2001:db8::1", |
|
|
|
forwardedPort: "443", |
|
|
|
forwardedProto: "https", |
|
|
|
expected: "[2001:db8::1]", |
|
|
|
expected: "2001:db8::1", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "IPv6 address with brackets but no port, should add port", |
|
|
|
@ -216,12 +216,12 @@ func TestExtractHostHeader(t *testing.T) { |
|
|
|
expected: "[2001:db8::1]:8080", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "IPv6 full address with brackets and default port (should strip port)", |
|
|
|
name: "IPv6 full address with brackets and default port (should strip port and brackets)", |
|
|
|
hostHeader: "backend:8333", |
|
|
|
forwardedHost: "[2001:db8:85a3::8a2e:370:7334]:443", |
|
|
|
forwardedPort: "443", |
|
|
|
forwardedProto: "https", |
|
|
|
expected: "[2001:db8:85a3::8a2e:370:7334]", |
|
|
|
expected: "2001:db8:85a3::8a2e:370:7334", |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: "IPv4-mapped IPv6 address without brackets, should add brackets with port", |
|
|
|
|