// directly, we don't know their scope, so we assume
// it's for *.domain.com.
- // TODO(bradfitz): once issue 16142 is fixed, make
- // this code use those URL accessors, and consider
- // "http://foo.com" and "http://foo.com:80" as
- // equivalent?
-
- // TODO(bradfitz): better hostname canonicalization,
- // at least once we figure out IDNA/Punycode (issue
- // 13835).
- ihost := strings.ToLower(initial.Host)
- dhost := strings.ToLower(dest.Host)
+ ihost := canonicalAddr(initial)
+ dhost := canonicalAddr(dest)
return isDomainOrSubdomain(dhost, ihost)
}
// All other headers are copied:
{"www-authenticate", "http://foo.com/", "http://foo.com/", true},
{"www-authenticate", "http://foo.com/", "http://sub.foo.com/", true},
{"www-authenticate", "http://foo.com/", "http://notfoo.com/", false},
- // TODO(bradfitz): make this test work, once issue 16142 is fixed:
- // {"www-authenticate", "http://foo.com:80/", "http://foo.com/", true},
+ {"www-authenticate", "http://foo.com/", "https://foo.com/", false},
+ {"www-authenticate", "http://foo.com:80/", "http://foo.com/", true},
+ {"www-authenticate", "http://foo.com:80/", "http://sub.foo.com/", true},
+ {"www-authenticate", "http://foo.com:443/", "https://foo.com/", true},
+ {"www-authenticate", "http://foo.com:443/", "https://sub.foo.com/", true},
+ {"www-authenticate", "http://foo.com:1234/", "http://foo.com/", false},
}
for i, tt := range tests {
u0, err := url.Parse(tt.initialURL)