Skip to content

Allow domain cookie to be set on ip address to replicate browser behavior #46637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/net/http/cookiejar/jar.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,13 @@ func (j *Jar) domainAndType(host, domain string) (string, bool, error) {
// host cookie.
return host, true, nil
}

if isIP(host) {
//Allow domain cookie to be set on ip address to replicate browser behaviour !!!
/*if isIP(host) {
// According to RFC 6265 domain-matching includes not being
// an IP address.
// TODO: This might be relaxed as in common browsers.
return "", false, errNoHostname
}
}*/

// From here on: If the cookie is valid, it is a domain cookie (with
// the one exception of a public suffix below).
Expand Down