@@ -40,6 +40,11 @@ func TestNormalizePaygateAudience(t *testing.T) {
4040 }{
4141 {name : "canonical origin" , value : "https://gateway.example.com" , want : "https://gateway.example.com" },
4242 {name : "normalizes case and trailing slash" , value : " HTTPS://Gateway.Example.COM/ " , want : "https://gateway.example.com" },
43+ {name : "strips default HTTPS port" , value : "https://gateway.example.com:443" , want : "https://gateway.example.com" },
44+ {name : "strips default HTTP port" , value : "http://localhost:80" , want : "http://localhost" },
45+ {name : "preserves non-default port" , value : "https://gateway.example.com:8443" , want : "https://gateway.example.com:8443" },
46+ {name : "normalizes IPv6 default port" , value : "https://[::1]:443" , want : "https://[::1]" },
47+ {name : "preserves IPv6 non-default port" , value : "https://[::1]:8443" , want : "https://[::1]:8443" },
4348 {name : "rejects path" , value : "https://gateway.example.com/api" , wantErr : "origin only" },
4449 {name : "rejects query" , value : "https://gateway.example.com?tenant=a" , wantErr : "origin only" },
4550 {name : "rejects credentials" , value : "https://user@gateway.example.com" , wantErr : "credentials" },
0 commit comments