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: some left out logging in net/http/cookie.go #10454

Closed
omerkirk opened this issue Apr 14, 2015 · 3 comments
Closed

net/http: some left out logging in net/http/cookie.go #10454

omerkirk opened this issue Apr 14, 2015 · 3 comments

Comments

@omerkirk
Copy link

There are log statements that cannot be suppressed in net/http/cookie.go file. These statements create too much log when we redirect output to log file. Is there anyway to connect these to a parameter like isDebug.
sanitizeOrWarn function

 332            log.Printf("net/http: invalid byte %q in %s; dropping invalid bytes", v[i], fieldName)

String() function

 153            } else {
 154                log.Printf("net/http: invalid Cookie.Domain %q; dropping domain attribute",
 155                    c.Domain)
 156            }
@ianlancetaylor ianlancetaylor changed the title some left out logging in net/http/cookie.go net/http: some left out logging in net/http/cookie.go Apr 14, 2015
@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Apr 14, 2015
@gopherbot
Copy link

CL https://golang.org/cl/9411 mentions this issue.

@bradfitz
Copy link
Contributor

@omerkirk, have you considered just filtering out things you don't want by installing your own filtering io.Writer implementation with log.SetOutput(io.Writer)? I think that might be cleaner than https://golang.org/cl/9411

Thoughts?

@bradfitz
Copy link
Contributor

@josharian and I looked into those warnings and they appear to only happen for when your own code is sending invalid cookies out. There are no other places to report those, so you should really be fixing your application instead of ignoring them.

Closing this bug for now, but feel free to argue otherwise if we're missing something.

@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.
Projects
None yet
Development

No branches or pull requests

4 participants