* Fix s3 auth with proxy request (#7403)

* * Fix s3 auth with proxy request

* * 6649 Add unit test for signature v4

* address comments

* fix for tests

* ipv6

* address comments

* setting scheme

Works for both cases (direct HTTPS and behind proxy)

* trim for ipv6

* Corrected Scheme Precedence Order

* trim

* accurate

---------

Co-authored-by: chrislu <chris.lu@gmail.com>
Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com>
This commit is contained in:
zuzuviewer
2025-10-30 09:01:18 +08:00
committed by GitHub
parent eaecd8328b
commit 7e624d5355
3 changed files with 222 additions and 32 deletions

View File

@@ -216,12 +216,12 @@ func TestExtractHostHeader(t *testing.T) {
expected: "[2001:db8::1]:8080",
},
{
name: "IPv6 full address with brackets and port",
name: "IPv6 full address with brackets and default port (should strip port)",
hostHeader: "backend:8333",
forwardedHost: "[2001:db8:85a3::8a2e:370:7334]:443",
forwardedPort: "443",
forwardedProto: "https",
expected: "[2001:db8:85a3::8a2e:370:7334]:443",
expected: "[2001:db8:85a3::8a2e:370:7334]",
},
{
name: "IPv4-mapped IPv6 address without brackets, should add brackets with port",