diff options
| author | Russ Cox <rsc@golang.org> | 2024-03-08 21:01:17 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2024-03-09 14:19:39 +0000 |
| commit | 74726defe99bb1e19cee35e27db697085f06fda1 (patch) | |
| tree | d6ca72b6d2d17b99de1001e0a53082b1ab0ad9db /src/net/http | |
| parent | 065c5d220e802e85d410a5e6adba0819ab71aeda (diff) | |
| download | go-74726defe99bb1e19cee35e27db697085f06fda1.tar.xz | |
internal/godebugs: test for use of IncNonDefault
A few recent godebugs are missing IncNonDefault uses.
Test for that, so that people remember to do it.
Filed bugs for the missing ones.
For #66215.
For #66216.
For #66217.
Change-Id: Ia3fd10fd108e1b003bb30a8bc2f83995c768fab6
Reviewed-on: https://go-review.googlesource.com/c/go/+/570275
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/net/http')
| -rw-r--r-- | src/net/http/transfer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go index 255e8bc45a..ee2107c418 100644 --- a/src/net/http/transfer.go +++ b/src/net/http/transfer.go @@ -1043,7 +1043,7 @@ func (bl bodyLocked) Read(p []byte) (n int, err error) { return bl.b.readLocked(p) } -var laxContentLength = godebug.New("httplaxcontentlength") +var httplaxcontentlength = godebug.New("httplaxcontentlength") // parseContentLength checks that the header is valid and then trims // whitespace. It returns -1 if no value is set otherwise the value @@ -1057,8 +1057,8 @@ func parseContentLength(clHeaders []string) (int64, error) { // The Content-Length must be a valid numeric value. // See: https://datatracker.ietf.org/doc/html/rfc2616/#section-14.13 if cl == "" { - if laxContentLength.Value() == "1" { - laxContentLength.IncNonDefault() + if httplaxcontentlength.Value() == "1" { + httplaxcontentlength.IncNonDefault() return -1, nil } return 0, badStringError("invalid empty Content-Length", cl) |
