Skip to content
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

net/http: why drop the leading dot of cookie.Domain? #9692

Closed
haoxins opened this issue Jan 26, 2015 · 2 comments

Comments

Projects
None yet
4 participants
@haoxins
Copy link

commented Jan 26, 2015

https://github.com/golang/go/blob/master/src/net/http/cookie.go#L144-L151

            // A c.Domain containing illegal characters is not
            // sanitized but simply dropped which turns the cookie
            // into a host-only cookie. A leading dot is okay
            // but won't be sent.
            d := c.Domain
            if d[0] == '.' {
                d = d[1:]
            }
            fmt.Fprintf(&b, "; Domain=%s", d)

@haoxins haoxins changed the title [question] net/http: why drop the leading dot? [question] net/http: why drop the leading dot of cookie.Domain? Jan 26, 2015

@adg

This comment has been minimized.

Copy link
Contributor

commented Jan 26, 2015

This isn't the place for questions. That place is https://groups.google.com/group/golang-nuts

@adg adg closed this Jan 26, 2015

@minux

This comment has been minimized.

Copy link
Member

commented Jan 26, 2015

The issue tracker is not for asking questions. Please ask on golang-nuts mailing list
instead. Thanks.

@mikioh mikioh changed the title [question] net/http: why drop the leading dot of cookie.Domain? net/http: why drop the leading dot of cookie.Domain? Jan 26, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.