-
Notifications
You must be signed in to change notification settings - Fork 18k
net/http: remove semicolon warning #49399
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
Comments
After scratching my head a bit, the literal only way I've found to silence these messages is to intercept the log output from the http server: https://play.golang.org/p/v66AEQjrG4H I don't think this is a reasonable approach to the issue though. |
cc @FiloSottile |
cc @neild also |
Just giving this a bump -- is there any plan to remove the log message in the future? I'm happy to do any leg work, but it's not clear what an acceptable path forward is |
I second this, the warning must be dismissable. |
I have found a workaround that works imho slightly better than filtering the log message out of the log
see here: https://go.dev/play/p/BcGLSVItJqU Note this completely circumvents In my case, it's currently desirable because replacing |
Please allow to disable this warning. In the use case of a proxy server we MUST keep semicolons untouched as they act as delimiters for parameters in ad requests sent to a third-party ad server. If we move to latest Go versions, this would result in billion of warnings flooding our log service provider and reaching our allowed quota. |
This was a generally unfortunate situation with no perfect tradeoff. We opted for a log line as there was real potential of breaking people's applications by dropping query parameters and we didn't want to do so silently. It has now been long enough that anyone who needed to be alerted of it has learned about it, or doesn't care. We should just remove the log line. |
Change https://go.dev/cl/470315 mentions this issue: |
This warning has outlived its usefulness. Let's drop it. |
I am curious if this change has been incorporated into a release. I am not exactly sure how to determine if it has made it yet. I am on go1.20.2 and still see the warning. |
This change is not yet in any release. It will be in the upcoming 1.21 release. |
it's already released and it's existing in Go1.21 |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Linux/x86_64
go env
OutputWhat did you do?
Issued a request with non-encoded semicolons in the query string
https://play.golang.org/p/GsAqh5-wdQl
What did you expect to see?
No log output - we could receive a request like this from the internet easily. We have no mechanism to both silence this warning and accept the new behavior. This can cause log flooding for us. Any server that receives requests from the internet may get similar requests.
The only way that we can upgrade to go 1.17 is by using
http.AllowQuerySemicolons
and accepting the behavior from previous versions.I understand the motivation to ensure that people are aware that there was a behavior change, but once we are aware, we're in a situation where there's really nothing we can do to silence these warnings. Any service that winds up with a nontrivial volume of requests that happen to have these query strings will get flooded with log output...I don't think that's any safer than the original issue it was trying to solve.
What did you see instead?
Un-silencable log output
The text was updated successfully, but these errors were encountered: