aboutsummaryrefslogtreecommitdiff
path: root/src/net/http
AgeCommit message (Collapse)Author
2022-11-19net/http: direct server logs to test output in testsDamien Neil
Set a logger in newClientServerTest that directs the server log output to the testing.T's log, so log output gets properly associated with the test that caused it. Change-Id: I13686ca35c3e21adae16b2fc37ce36daea3df9d5 Reviewed-on: https://go-review.googlesource.com/c/go/+/452075 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-11-18net/http: regenerate h2_bundle.goDmitri Shuralyov
Done with: go generate -run=bundle std After CL 452096 updated the x/net version. Change-Id: I1c1cd76d4ec9e14f45dc66c945c74e41ff689a30 Reviewed-on: https://go-review.googlesource.com/c/go/+/452195 Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-11-18crypto/tls: add CertificateVerificationError to tls handshakeGabor Tanz
Fixes #48152 Change-Id: I503f088edeb5574fd5eb5905bff7c3c23b2bc8fc GitHub-Last-Rev: 2b0e982f3f6bca33062b0bbd64ed1804801e2c13 GitHub-Pull-Request: golang/go#56686 Reviewed-on: https://go-review.googlesource.com/c/go/+/449336 Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org>
2022-11-18all: add missing periods in commentscui fliter
Change-Id: I69065f8adf101fdb28682c55997f503013a50e29 Reviewed-on: https://go-review.googlesource.com/c/go/+/449757 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Joedian Reid <joedian@golang.org> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Joedian Reid <joedian@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-11-17net/http: deflake TestResponseControllerSetFutureWriteDeadlineDamien Neil
Don't set the server's write deadline until after the client has read the response headers, avoiding test failures if the deadline expires before or while writing headers. Fixes #56807. Change-Id: I5f80c108b360d030132a13661774a30fac453856 Reviewed-on: https://go-review.googlesource.com/c/go/+/451715 Auto-Submit: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-11-15net/url, net/http/httputil: accept invalid percent encodingsIan Lance Taylor
Per https://url.spec.whatwg.org/#percent-encoded-bytes an invalid percent encoding should be handled as ordinary text. Fixes #56732 Change-Id: Ib0259dfd704922905289eebaacbf722e28f6d636 Reviewed-on: https://go-review.googlesource.com/c/go/+/450375 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-14internal/godebug: define more efficient APIRuss Cox
We have been expanding our use of GODEBUG for compatibility, and the current implementation forces a tradeoff between freshness and efficiency. It parses the environment variable in full each time it is called, which is expensive. But if clients cache the result, they won't respond to run-time GODEBUG changes, as happened with x509sha1 (#56436). This CL changes the GODEBUG API to provide efficient, up-to-date results. Instead of a single Get function, New returns a *godebug.Setting that itself has a Get method. Clients can save the result of New, which is no more expensive than errors.New, in a global variable, and then call that variable's Get method to get the value. Get costs only two atomic loads in the case where the variable hasn't changed since the last call. Unfortunately, these changes do require importing sync from godebug, which will mean that sync itself will never be able to use a GODEBUG setting. That doesn't seem like such a hardship. If it was really necessary, the runtime could pass a setting to package sync itself at startup, with the caveat that that setting, like the ones used by runtime itself, would not respond to run-time GODEBUG changes. Change-Id: I99a3acfa24fb2a692610af26a5d14bbc62c966ac Reviewed-on: https://go-review.googlesource.com/c/go/+/449504 Run-TryBot: Russ Cox <rsc@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-11net/http: fix triv.goRuss Cox
CL 428137 replaced 'buf := make(bytes.Buffer)' with 'var buf strings.Builder'. That change also requires passing &buf to io.Copy instead of buf. Change-Id: I72b3faa46693e7d1441298f49dc6b95859c3bff3 Reviewed-on: https://go-review.googlesource.com/c/go/+/449635 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Russ Cox <rsc@golang.org>
2022-11-10net/http: build error chains in transport that can be unwrappedMarcus Weiner
In some places of the HTTP transport errors were constructed that wrapped other errors without providing the ability to call `errors.Unwrap` on them to get the underlying error. These places have been fixed to use `%w` when using `fmt.Errorf` or to implement `Unwrap() error`. Fixes #56435 Change-Id: Ieed3359281574485c8d0b18298e25e5f1e14555c GitHub-Last-Rev: 504efbc507a50bd2cf63001511733e232927089f GitHub-Pull-Request: golang/go#56451 Reviewed-on: https://go-review.googlesource.com/c/go/+/445775 Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Damien Neil <dneil@google.com>
2022-11-10net/http: add ResponseController and per-handler timeoutsDamien Neil
The ResponseController type provides a discoverable interface to optional methods implemented by ResponseWriters. c := http.NewResponseController(w) c.Flush() vs. if f, ok := w.(http.Flusher); ok { f.Flush() } Add the ability to control per-request read and write deadlines via the ResponseController SetReadDeadline and SetWriteDeadline methods. For #54136 Change-Id: I3f97de60d4c9ff150cda559ef86c6620eee665d2 Reviewed-on: https://go-review.googlesource.com/c/go/+/436890 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Damien Neil <dneil@google.com>
2022-11-10net/http: add tests for Server.ReadTimeout and server.WriteTimeoutDamien Neil
We don't seem to have tests verifying that handler reads from the request body or writes to the response body time out properly. Add some. For #49837 For #56478 Change-Id: I0828edd6c86b071073fd1b22ccbb24f86114ab94 Reviewed-on: https://go-review.googlesource.com/c/go/+/446255 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-11-09net/http: add Transport.OnProxyConnectResponsecuiweixie
Fixes #54299 Change-Id: I3a29527bde7ac71f3824e771982db4257234e9ef Reviewed-on: https://go-review.googlesource.com/c/go/+/447216 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: xie cui <523516579@qq.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2022-11-09all: fix some commentscui fliter
Change-Id: I163ea3a770f2228f67d4fb1374653566e64b91f7 Reviewed-on: https://go-review.googlesource.com/c/go/+/448575 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-11-08net/textproto: reject invalid header keys/values in ReadMIMEHeaderDamien Neil
Return an error when parsing a MIME header containing bytes in the key or value outside the set allowed by RFC 7230. For historical compatibility, accept spaces in keys (but do not canonicalize the key in this case). For #53188. Change-Id: I195319362a2fc69c4e506644f78c5026db070379 Reviewed-on: https://go-review.googlesource.com/c/go/+/410714 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
2022-11-08net/http: remove redundant codetk
Remove redundant code at line 365, `oldCtx := req.Context()`, because it's the same as line 349. Change-Id: I9b028e8c8740c22945708b143e4e86a0baa40f64 GitHub-Last-Rev: 4ad0f3871b1d473246af7cf27c158140c7248cf1 GitHub-Pull-Request: golang/go#54925 Reviewed-on: https://go-review.googlesource.com/c/go/+/428977 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Damien Neil <dneil@google.com>
2022-11-04all: fix function names in commentscui fliter
Change-Id: I871a747b4b47bccc889f2fdc93a2bcebb041b719 Reviewed-on: https://go-review.googlesource.com/c/go/+/447895 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-11-04net/http: ignore ranges if the content is empty in serveContentJorropo
Fixes #54794 Change-Id: I6f2b7b86b82ea27b9d53cf989daa21cb8ace13da Reviewed-on: https://go-review.googlesource.com/c/go/+/427195 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-31net/http: deflake TestCancelRequestWhenSharingConnectionZeke Lu
The test sleeps for 1 millisecond to give the cancellation a moment to take effect. This is flaky because the request can finish before the cancellation of the context is seen. It's easy to verify by adding time.Sleep(2*time.Millisecond) after https://github.com/golang/go/blob/0a6c4c87404ecb018faf002919e5d5db04c69ee2/src/net/http/transport.go#L2619. With this modification, the test fails about 5 times out of 10 runs. The fix is easy. We just need to block the handler of the second request until this request is cancelled. I have verify that the updated test can uncover the issue fixed by CL 257818. Fixes #55226. Change-Id: I81575beef1a920a2ffaa5c6a5ca70a4008bd5f94 GitHub-Last-Rev: 99cb1c2eaed7839394adbb6bbcd4950cd4bfb6f3 GitHub-Pull-Request: golang/go#56500 Reviewed-on: https://go-review.googlesource.com/c/go/+/446676 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-10-26all: update golang.org/x/tools to 8166dca1cec9Wayne Zuo
To pick up CL 443575. Note: This CL also update other x repositories because CL 444536 updates x/tools dependencies to latest tagged version. Done by go get -d golang.org/x/tools@8166dca1cec9 go mod tidy go mod vendor Change-Id: Ie2836bb4ebc1db0150ba240af4e2b750dbf1e0b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/445055 Run-TryBot: Wayne Zuo <wdvxdr@golangcn.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-10-14net/http: skip TestTransportPersistConnLeak/h2Damien Neil
We started running this test under HTTP/2 in a recent refactoring. It seems to be flaky for HTTP/2; skip it for now. Change-Id: I8b270afe7f0d3db307b5a951e16f576116333003 Reviewed-on: https://go-review.googlesource.com/c/go/+/443075 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Damien Neil <dneil@google.com>
2022-10-12net/http: fix some test flakes caused by test refactoringDamien Neil
Skip TestTransportPersistConnLeakShortBody in HTTP/2 mode; it's flaky and was previously HTTP/1-only. Don't run TestTransportEventTrace and TestTransportIgnores408 in parallel. Change-Id: I76bc540fac9317185ef7d414c9deafb35bc926b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/442495 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-07net/http: refactor tests to run most in HTTP/1 and HTTP/2 modesDamien Neil
Replace the ad-hoc approach to running tests in HTTP/1 and HTTP/2 modes with a 'run' function that executes a test in various modes. By default, these modes are HTTP/1 and HTTP/2, but tests can opt-in to HTTPS/1 as well. The 'run' function also takes care of post-test cleanup (running the afterTest function). The 'run' function runs tests in parallel by default. Tests which can't run in parallel (generally because they use global test hooks) pass a testNotParallel option to disable parallelism. Update clientServerTest to use t.Cleanup to clean up after itself, rather than leaving this up to tests to handle. Drop an unnecessary mutex in SetReadLoopBeforeNextReadHook. Test hooks can't be set in parallel, and we want the race detector to notify us if two simultaneous tests try to set a hook. Fixes #56032 Change-Id: I16be64913c426fc93d84abc6ad85dbd3bc191224 Reviewed-on: https://go-review.googlesource.com/c/go/+/438137 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-09-29net/http: using strings.CutPrefix replace strings.HasPrefix and ↵cuiweixie
strings.TrimPrefix Change-Id: I0b7b6e4e9d2539e4fcb5c08430ba5a74733fad3c Reviewed-on: https://go-review.googlesource.com/c/go/+/435136 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: xie cui <523516579@qq.com>
2022-09-29net/http: remove deadstore statementcuiweixie
Change-Id: Icfa3fd519df48f8d7d7aa3795535fd7e6aaa159f Reviewed-on: https://go-review.googlesource.com/c/go/+/435936 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-29net/http: use time.Comparecuiweixie
Change-Id: I4730673130bdfbda9987dcb5869f421082f92150 Reviewed-on: https://go-review.googlesource.com/c/go/+/435615 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-09-28all: fix some typoscui fliter
Change-Id: I8b28aebbb9494b2c877139a4584a5a42253e3bea GitHub-Last-Rev: e3703fd3a50b811785df75751472aa3ab098b3d1 GitHub-Pull-Request: golang/go#55902 Reviewed-on: https://go-review.googlesource.com/c/go/+/435617 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-09-27net/http: fix the potential leak of textproto.Reader from poolAndy Pan
Fixes #55835 Change-Id: I6109bab2941b859e8cfef22f65a6a3a5f977a8d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/433835 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Andy Pan <panjf2000@gmail.com> Run-TryBot: Ian Lance Taylor <iant@google.com>
2022-09-23net/http/httputil: avoid query parameter smugglingDamien Neil
Query parameter smuggling occurs when a proxy's interpretation of query parameters differs from that of a downstream server. Change ReverseProxy to avoid forwarding ignored query parameters. Remove unparsable query parameters from the outbound request * if req.Form != nil after calling ReverseProxy.Director; and * before calling ReverseProxy.Rewrite. This change preserves the existing behavior of forwarding the raw query untouched if a Director hook does not parse the query by calling Request.ParseForm (possibly indirectly). Fixes #54663 Fixes CVE-2022-2880 Change-Id: If1621f6b0e73a49d79059dae9e6b256e0ff18ca9 Reviewed-on: https://go-review.googlesource.com/c/go/+/432976 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
2022-09-21net/http: add tracing to TestTransportReuseConnection_Gzip_*Damien Neil
These tests are flaky; add some additional logging in hopes it will aid in debugging. For #53373 Change-Id: I971a2815f50932a9700ef8c2f684c5416951e6de Reviewed-on: https://go-review.googlesource.com/c/go/+/432375 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-21net/http: accept HEAD requests with a bodyDamien Neil
RFC 7231 permits HEAD requests to contain a body, although it does state there are no defined semantics for payloads of HEAD requests and that some servers may reject HEAD requests with a payload. Accept HEAD requests with a body. Fix a bug where a HEAD request with a chunked body would interpret the body as the headers for the next request on the connection. For #53960. Change-Id: I83f7112fdedabd6d6291cd956151d718ee6942cd Reviewed-on: https://go-review.googlesource.com/c/go/+/418614 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-21all: update vendored golang.org/x/netDamien Neil
Pull in HTTP/2 fix needed for net/http test case. f8f703f979 http2: accept HEAD requests with a body For #53960 Change-Id: I59bbd83977daced5ed21ec5345af8cdb607e532e Reviewed-on: https://go-review.googlesource.com/c/go/+/432197 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-09-19net/http: convert Server.disableKeepAlives to atomic typecuiweixie
Change-Id: I87526520b519554ea344288cc0f0940d7b182e21 Reviewed-on: https://go-review.googlesource.com/c/go/+/428815 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2022-09-19net/http: correctly test for leading header spaces in TestReadRequest_BadDamien Neil
TestReadRequest_Bad's tests for leading whitespace in the first header were also exercising the test verifying that a HEAD request has no Content-Length. Also, the test intended to test a leading tab was actually testing for a leading \t (literal backslash, literal t). Change-Id: I05b46d05851b49bf75f1d1257c421b953b66ea9c Reviewed-on: https://go-review.googlesource.com/c/go/+/428134 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2022-09-16net/http: deflake TestServerCancelsReadHeaderTimeoutWhenIdleBryan C. Mills
Return errors instead of calling t.Fatalf for timing-sensitive failure modes. Scale the Sleep call to the timeout (so that it isn't too short for the longer durations). Fixes #54891. Change-Id: I574e85e121becdda9ab8ee6bfd37c18a549d366d Reviewed-on: https://go-review.googlesource.com/c/go/+/430955 Reviewed-by: Joel Sing <joel@sing.id.au> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-16net/http/httputil: remove duplicated code blockDamien Neil
Remove a harmless but redundant section of code introduced in CL 407214. Change-Id: Id6522e6ff13a283d726b3b97dfc72f101884f733 Reviewed-on: https://go-review.googlesource.com/c/go/+/431395 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Damien Neil <dneil@google.com>
2022-09-14net/http/httputil: forward 1xx responses in ReverseProxyKévin Dunglas
Support for 1xx responses has recently been merged in net/http (CL 269997). As discussed in this CL (https://go-review.googlesource.com/c/go/+/269997/comments/1ff70bef_c25a829a), support for forwarding 1xx responses in ReverseProxy has been extracted in this separate patch. According to RFC 7231, "a proxy MUST forward 1xx responses unless the proxy itself requested the generation of the 1xx response". Consequently, all received 1xx responses are automatically forwarded as long as the underlying transport supports ClientTrace.Got1xxResponse. Fixes #26088 Fixes #51914 Change-Id: I3a35ea023b798bfe56b7fb8696d5a49695229cfd GitHub-Last-Rev: dab8a461fb65b547306cae9b4c664e60020a8fa6 GitHub-Pull-Request: golang/go#53164 Reviewed-on: https://go-review.googlesource.com/c/go/+/409536 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Rhys Hiltner <rhys@justin.tv> Run-TryBot: hopehook <hopehook@golangcn.org>
2022-09-13net/http: make DefaultTransport docs about HTTP proxy consistentVladimir Varankin
The changes improve the documentation for DefaultTransport, making the style with how the HTTP proxy environment variables are being referred to, consistent with the rest of the project's documentation. Also mention HTTPS_PROXY environment variables, as suggested in #32649. Change-Id: I4e6b49881d7b30b5a0d4699531fa7c2929fc49f7 GitHub-Last-Rev: 2fc751937be685aa45acf43cf37b8ba2da124e4e GitHub-Pull-Request: golang/go#54996 Reviewed-on: https://go-review.googlesource.com/c/go/+/430135 Reviewed-by: Damien Neil <dneil@google.com> Auto-Submit: Jenny Rakoczy <jenny@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Jenny Rakoczy <jenny@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-09net/http: convert allowQuerySemicolonsInUse to atomic typecui fliter
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>
2022-09-07net/http: use strings.Buildercuiweixie
Change-Id: I754edcf21e003a3f4037fb2c5d8d06f2cd5f2fa3 Reviewed-on: https://go-review.googlesource.com/c/go/+/428267 Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Run-TryBot: xie cui <523516579@qq.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2022-09-06all: update vendored golang.org/x/netDamien Neil
Pull in security fix: f3363e06e7 http2: handle server errors after sending GOAWAY Fixes CVE-2022-27664 Fixes golang/go#54658 Change-Id: Ie1f58a8d769c7fd75c67d202c611a3abfd7dbb35 Reviewed-on: https://go-review.googlesource.com/c/go/+/428717 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Damien Neil <dneil@google.com>
2022-09-06net/http: clarify proxy selection from environmentSean Liao
For #40909 Fixes #54890 Change-Id: I00218bc1606eedb6194a3a7b81fd4d3f75325280 Reviewed-on: https://go-review.googlesource.com/c/go/+/428775 Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Damien Neil <dneil@google.com>
2022-09-06net/http: using strings.Buildercuiweixie
Change-Id: I5d4c89a8d87a8697d038bf91b17d7ffc847a49c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/428137 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: xie cui <523516579@qq.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-06net/http/cgi: use strings.Buildercuiweixie
Change-Id: Ie5a8ae104970237e6e33e75cae807c436bcd08e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/428268 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-06net/http/httptrace: use strings.Buildercuiweixie
Change-Id: I407d11b43349cd78b709deb7b0e774bd93922caa Reviewed-on: https://go-review.googlesource.com/c/go/+/428269 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-06net/http/httputil: use strings.Buildercuiweixie
Change-Id: Ifb51413894791154489bd1d4f529088958212c62 Reviewed-on: https://go-review.googlesource.com/c/go/+/428270 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-09-06net/http: make triv.go example less insecureDamien Neil
The triv.go example serves the entire contents of $HOME by default. That seems bad, let's not do that. Also change it to listen on localhost only. Change-Id: I8f1b7bd6b7d737852273e2ba82deabc4a2d11f6b Reviewed-on: https://go-review.googlesource.com/c/go/+/428237 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatiana@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-09-05net/http: don't time out idle server connections after ReadHeaderTimeoutEliza Weisman
Consistently wait for idle connections to become readable before starting the ReadHeaderTimeout timer. Previously, connections with no idle timeout skipped directly to reading headers, so the ReadHeaderTimeout also included time spent idle. Fixes #54784 Change-Id: Iff1a876f00311d03dfa0fbef5b577506c62f7c41 GitHub-Last-Rev: 09332743ad6d5a9eb1137adaade2810c583d38ca GitHub-Pull-Request: golang/go#54785 Reviewed-on: https://go-review.googlesource.com/c/go/+/426895 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2022-08-31net/http/pprof: link docs to runtime/pprofSean Liao
And add some documentation for the debug query param. Fixes #27737 Fixes #53971 Change-Id: I629aaa2d4a43175381eb04872f1caad238519a41 Reviewed-on: https://go-review.googlesource.com/c/go/+/421635 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-29net/http: FileServer method check + minimal OPTIONS implementationPascal S. de Kloe
FileServer provides a read-only service. Methods other than GET or HEAD should be denied with an Allow header. Fixes #53501 Change-Id: I1d31b405eefd90565ecd474ac3f8d8d6e3b15072 Reviewed-on: https://go-review.googlesource.com/c/go/+/413554 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-08-26net/http: don't panic on very large MaxBytesReaderLimitcuiweixie
Fixes #54408 Change-Id: I454199ae5bcd087b8fc4169b7622412105e71113 GitHub-Last-Rev: a33fe7e206d0c394440962acd360df3aa9b117c3 GitHub-Pull-Request: golang/go#54415 Reviewed-on: https://go-review.googlesource.com/c/go/+/423314 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: xie cui <523516579@qq.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: hopehook <hopehook@qq.com>