For #53821
Change-Id: I135783bd5472011f6a74d2f5ee34ce96ff49ad2b
GitHub-Last-Rev:
4da2d67ff3d19424c306e1de6a4152fc93785a97
GitHub-Pull-Request: golang/go#54863
Reviewed-on: https://go-review.googlesource.com/c/go/+/428336
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
}
if req.URL != nil && strings.Contains(req.URL.RawQuery, ";") {
- var allowQuerySemicolonsInUse int32
+ var allowQuerySemicolonsInUse atomic.Bool
req = req.WithContext(context.WithValue(req.Context(), silenceSemWarnContextKey, func() {
- atomic.StoreInt32(&allowQuerySemicolonsInUse, 1)
+ allowQuerySemicolonsInUse.Store(true)
}))
defer func() {
- if atomic.LoadInt32(&allowQuerySemicolonsInUse) == 0 {
+ if !allowQuerySemicolonsInUse.Load() {
sh.srv.logf("http: URL query contains semicolon, which is no longer a supported separator; parts of the query may be stripped when parsed; see golang.org/issue/25192")
}
}()