From 74726defe99bb1e19cee35e27db697085f06fda1 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 8 Mar 2024 21:01:17 -0500 Subject: 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 Reviewed-by: Damien Neil --- src/net/http/transfer.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/net/http') 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) -- cgit v1.3-5-g9baa