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

Comments

Projects
None yet
4 participants
@omerkirk
Copy link

commented Apr 14, 2015

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

This comment has been minimized.

Copy link

commented Apr 28, 2015

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

@bradfitz

This comment has been minimized.

Copy link
Member

commented Apr 28, 2015

@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

This comment has been minimized.

Copy link
Member

commented Apr 28, 2015

@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.

@bradfitz bradfitz closed this Apr 28, 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.