- 26 Aug, 2019 1 commit
-
-
Kevin Gillette authored
The doc comments of both ServerContextKey and LocalAddrContextKey both suggest that context.WithValue can be used to access (get) properties of the server or connection. This PR fixes those comments to refer to Context.Value instead. Change-Id: I4ed383ef97ba1951f90c555243007469cfc18d4d GitHub-Last-Rev: 05bc3acf82322e3dc77abc7fa0412efe01a77eac GitHub-Pull-Request: golang/go#33833 Reviewed-on: https://go-review.googlesource.com/c/go/+/191838 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 22 Aug, 2019 1 commit
-
-
Jeff Hodges authored
As of Go 1.13rc1, TimeoutHandler supports the Flusher and Pusher interfaces and this change corrects its documentation to say that. Fixes #33769 Updates #29193 Change-Id: Ia0523f7f2e3dc1f8f0b68950b85a7bf81c4abe60 GitHub-Last-Rev: 5310d2c9608a1af2d3030a9573e920906c76744e GitHub-Pull-Request: golang/go#33770 Reviewed-on: https://go-review.googlesource.com/c/go/+/191237 Reviewed-by:
Andrew Bonventre <andybons@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 19 Jun, 2019 1 commit
-
-
Raghavendra Nagaraj authored
CL 46434 changed the doc for Server.IdleTimeout to include falling back to Server.ReadHeaderTimeout if both Server.IdleTimeout and Server.ReadTimeout are zero. However, we explicitly set the ReadDeadlines firstly based off Server.IdleTimeout or Server.ReadTimeout before attempting to read the next request, thus the current doc is incorrect. This CL reverts CL 46434 and also updates the doc for Server.ReadHeaderTimeout to documenting falling back to Server.ReadTimeout, if the former is zero, otherwise there is no timeout. Fixes #32053 Change-Id: I43dd0252d1bcee6c29a8529abd84c84a49b2fba9 GitHub-Last-Rev: e1cdb599772476e0b52d9d2374c3ea3893844eb4 GitHub-Pull-Request: golang/go#32164 Reviewed-on: https://go-review.googlesource.com/c/go/+/178337 Reviewed-by:
Emmanuel Odeke <emm.odeke@gmail.com>
-
- 10 Jun, 2019 1 commit
-
-
Andrew Bonventre authored
Change-Id: I684e3522e387b2d96d5cfb2878d2f77bf4558443 Reviewed-on: https://go-review.googlesource.com/c/go/+/181545 Reviewed-by:
Bryan C. Mills <bcmills@google.com>
-
- 07 Jun, 2019 1 commit
-
-
Brad Fitzpatrick authored
This is the net/http half of #32476. This supplies the method needed by the other half in x/net/http2 in the already-submitted CL 181259, which this CL also bundles in h2_bundle.go. Thanks to Tom Thorogood (@tmthrgd) for the bug report and test. Fixes #32476 Updates #30694 Change-Id: I79d2a280e486fbf75d116f6695fd3abb61278765 Reviewed-on: https://go-review.googlesource.com/c/go/+/181260 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 04 Jun, 2019 1 commit
-
-
Dmitri Shuralyov authored
Roll back CL 161738. That fix changed StripPrefix behavior in the general case, not just in the situation where where stripping the prefix from path resulted in the empty string, causing issue #31622. That kind of change to StripPrefix behavior is not backwards compatible, and there can be a smaller, more targeted fix for the original issue. Fixes #31622 Updates #30165 Change-Id: Ie2fcfe6787a32e44f71d564d8f9c9d580fc6f704 Reviewed-on: https://go-review.googlesource.com/c/go/+/180498 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 30 Apr, 2019 1 commit
-
-
Emmanuel T Odeke authored
Ensures that our HTTP/1.X Server properly responds with a 501 Unimplemented as mandated by the spec at RFC 7230 Section 3.3.1, which says: A server that receives a request message with a transfer coding it does not understand SHOULD respond with 501 (Unimplemented). Fixes #30710 Change-Id: I096904e6df053cd1e4b551774cc27523ff3d09f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/167017 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 24 Apr, 2019 1 commit
-
-
Brad Fitzpatrick authored
Fixes #29915 Change-Id: I6e6edf4f9a0e062211f74d120ae1a242bce1b274 Reviewed-on: https://go-review.googlesource.com/c/go/+/173658 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ingo Oeser <nightlyone@googlemail.com> Reviewed-by:
Benny Siegert <bsiegert@gmail.com>
-
- 15 Apr, 2019 1 commit
-
-
Brad Fitzpatrick authored
Fixes golang/go#30694 Change-Id: I12a0a870e4aee6576e879d88a4868666ef448298 Reviewed-on: https://go-review.googlesource.com/c/go/+/167681 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
JP Sugarbroad <jpsugar@google.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 04 Apr, 2019 1 commit
-
-
Leo Antunes authored
This commit adds a KeepAlive field to ListenConfig and uses it analogously to Dialer.KeepAlive to set TCP KeepAlives per default on Accept() Fixes #23378 Change-Id: I57eaf9508c979e7f0e2b8c5dd8e8901f6eb27fd6 GitHub-Last-Rev: e9e035d53ee8aa3d899d12db08b293f599daecb6 GitHub-Pull-Request: golang/go#31242 Reviewed-on: https://go-review.googlesource.com/c/go/+/170678 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 11 Mar, 2019 1 commit
-
-
Bryan C. Mills authored
This also updates the vendored-in versions of several packages: 'go mod vendor' selects a consistent version of each module, but we had previously vendored an ad-hoc selection of packages. Notably, x/crypto/hkdf was previously vendored in at a much newer commit than the rest of x/crypto. Bringing the rest of x/crypto up to that commit introduced an import of golang.org/x/sys/cpu, which broke the js/wasm build, requiring an upgrade of x/sys to pick up CL 165749. Updates #30228 Updates #30241 Updates #25822 Change-Id: I5b3dbc232b7e6a048a158cbd8d36137af1efb711 Reviewed-on: https://go-review.googlesource.com/c/go/+/164623 Reviewed-by:
Filippo Valsorda <filippo@golang.org>
-
- 05 Mar, 2019 1 commit
-
-
Daniel Martí authored
I had been finding these over a year or so, but none were big enough changes to warrant CLs. They're a handful now, so clean them all up in a single commit. The smaller bodies get a bit simpler, but most importantly, the larger bodies get unindented. Change-Id: I5707a6fee27d4c9ff9efd3d363af575d7a4bf2aa Reviewed-on: https://go-review.googlesource.com/c/go/+/165340 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 02 Mar, 2019 1 commit
-
-
LE Manh Cuong authored
Fixes #29193 Change-Id: I03088205e51036abbc861ab5b7d141327b0429ae Reviewed-on: https://go-review.googlesource.com/c/154383 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 26 Feb, 2019 1 commit
-
-
Ggicci authored
The path of the new stripped URL should also be cleaned. Since an empty path may cause unexpected errors in some HTTP handlers, e.g. http.ServeFile. Fixes #30165 Change-Id: Ib44fdce6388b5d62ffbcab5266925ef8f13f26e2 Reviewed-on: https://go-review.googlesource.com/c/161738 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 02 Dec, 2018 1 commit
-
-
Tobias Klauser authored
Follow-up for CL 147037 and after Brad noticed the "returns whether" pattern during the review of CL 150621. Go documentation style for boolean funcs is to say: // Foo reports whether ... func Foo() bool (rather than "returns whether") Created with: $ perl -i -npe 's/returns whether/reports whether/' $(git grep -l "returns whether" | grep -v vendor) Change-Id: I15fe9ff99180ad97750cd05a10eceafdb12dc0b4 Reviewed-on: https://go-review.googlesource.com/c/150918 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 29 Nov, 2018 1 commit
-
-
Bryan C. Mills authored
Packages in vendor/ directories have a "vendor/" path prefix in GOPATH mode, but intentionally do not in module mode. Since the import path is embedded in the compiled output, changing that path invalidates cache entries and causes cmd/go to try to rebuild (and reinstall) the vendored libraries, which will fail if the directory containing those libraries is read-only. If I understood correctly, this is the approach Russ suggested as an alternative to https://golang.org/cl/136138. Fixes #27285 Fixes #26988 Change-Id: I8a2507fa892b84cde0a803aaa79e460723da572b Reviewed-on: https://go-review.googlesource.com/c/147443 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 14 Nov, 2018 1 commit
-
-
Brad Fitzpatrick authored
Fixes #19943 Change-Id: I5e0fefe44791d7b3556095d726c2a753ec551ef2 Reviewed-on: https://go-review.googlesource.com/c/147457 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Dmitri Shuralyov <dmitshur@golang.org>
-
- 02 Nov, 2018 1 commit
-
-
Carl Mastrangelo authored
Scanning through all path patterns is not necessary, since the paths do not change frequently. Instead, maintain a sorted list of path prefixes and return the first match. name old time/op new time/op delta ServerMatch-12 134ns ± 3% 17ns ± 4% -86.95% (p=0.000 n=19+20) Change-Id: I15b4483dc30db413321435ee6815fc9bf2bcc546 Reviewed-on: https://go-review.googlesource.com/c/144937 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 25 Oct, 2018 1 commit
-
-
Brad Fitzpatrick authored
Updates #23689 Change-Id: Icddec2fcc39802cacd651a9c94290e86cf1e48d1 Reviewed-on: https://go-review.googlesource.com/c/144517 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 24 Oct, 2018 1 commit
-
-
Brad Fitzpatrick authored
This adds a crypto/tls.RecordHeaderError.Conn field containing the TLS underlying net.Conn for non-TLS handshake errors, and then uses it in the net/http Server to return plaintext HTTP 400 errors when a client mistakenly sends a plaintext HTTP request to an HTTPS server. This is the same behavior as Apache. Also in crypto/tls: swap two error paths to not use a value before it's valid, and don't send a alert record when a handshake contains a bogus TLS record (a TLS record in response won't help a non-TLS client). Fixes #23689 Change-Id: Ife774b1e3886beb66f25ae4587c62123ccefe847 Reviewed-on: https://go-review.googlesource.com/c/143177 Reviewed-by:
Filippo Valsorda <filippo@golang.org>
-
- 03 Oct, 2018 1 commit
-
-
David Url authored
If an illegal header write is detected, find the first caller outside of net/http using runtime.CallersFrames and include the call site in the log message. Fixes #18761 Change-Id: I92be00ac206c6ebdd60344ad7bf40a7c4c188547 Reviewed-on: https://go-review.googlesource.com/c/130997 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 21 Aug, 2018 1 commit
-
-
Tim Cooper authored
Change-Id: I93bc5de6bcb23c2639d7c2f3f5252fb6f09ca6e4 Reviewed-on: https://go-review.googlesource.com/126797 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 31 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Also updates the bundled http2 to x/net/http2 git rev 49c15d80 for: http2: revert CL 107295 (don't sniff Content-type in Server when nosniff) https://golang.org/cl/126895 Fixes #24795 Change-Id: I6ae1a21c919947089274e816eb628d20490f83ce Reviewed-on: https://go-review.googlesource.com/126896 Reviewed-by:
Damien Neil <dneil@google.com>
-
- 24 Jul, 2018 2 commits
-
-
Filippo Valsorda authored
The only inaccurate part was the HTTP/2 caveat in Server.ServeTLS, which only applies to the plain Serve variant. The restriction implemented in shouldConfigureHTTP2ForServe is not on the setupHTTP2_ServeTLS codepath because ServeTLS owns the tls.Listener, so we fix it for the user instead of disabling HTTP/2. Fixes #24607 Change-Id: Ie5f207d0201f09db27bf81b75535e5f6fdaf91e2 Reviewed-on: https://go-review.googlesource.com/103815 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
Brad Fitzpatrick authored
Updates #9424 Change-Id: If117ba3e7d031f84b30d3a721ef99fe622734de2 Reviewed-on: https://go-review.googlesource.com/125575 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 23 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Contains portions and modified portions of CL 103815 Fixes #24607 Change-Id: Ic330850a0f098f183315f04ea4780eded46c5b77 Reviewed-on: https://go-review.googlesource.com/125515 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 13 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
See big comment in code. Fixes #23921 Change-Id: I2dbd1acc2e9da07a71f9e0640aafe0c59a335627 Reviewed-on: https://go-review.googlesource.com/123875 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 10 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Per comments in https://github.com/golang/go/issues/20239#issuecomment-402199944 Updates #20239 Updates #26303 Change-Id: Iddf34c0452bd30ca9111b951bca48d1e011bd85a Reviewed-on: https://go-review.googlesource.com/122820 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 09 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Fixes #24201 Change-Id: Ib970c4eeaa90489d014482276a7e5afa94a50741 Reviewed-on: https://go-review.googlesource.com/122675 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 06 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Change-Id: Ie801fe6a2883d79229ee2955e26948c1b4964802 Reviewed-on: https://go-review.googlesource.com/122496 Reviewed-by:
Russ Cox <rsc@golang.org>
-
- 03 Jul, 2018 1 commit
-
-
Brad Fitzpatrick authored
Fixes #20239 Change-Id: Icb021daad82e6905f536e4ef09ab219500b08167 Reviewed-on: https://go-review.googlesource.com/81778 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
- 28 Jun, 2018 1 commit
-
-
Brad Fitzpatrick authored
The Server distinguishes "new" vs "idle" connections. A TCP connection from which no bytes have yet been written is "new". A connection that has previously served a request and is in "keep-alive" state while waiting for a second or further request is "idle". The graceful Server.Shutdown historically only shut down "idle" connections, with the assumption that a "new" connection was about to read its request and would then shut down on its own afterwards. But apparently some clients spin up connections and don't end up using them, so we have something that's "new" to us, but browsers or other clients are treating as "idle" to them. This CL tweaks our heuristic to treat a StateNew connection as StateIdle if it's been stuck in StateNew for over 5 seconds. Fixes #22682 Change-Id: I01ba59a6ab67755ca5ab567041b1f54aa7b7da6f Reviewed-on: https://go-review.googlesource.com/121419 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by:
Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 27 Jun, 2018 1 commit
-
-
Meir Fischer authored
Some headers, which are set or modified by the http library, are not written to the standard http.Request.Header and are not included as part of http.Response.Request.Header. Exposing all headers alleviates this problem. This is not a complete solution to 19761 since it does not have http/2 support. Updates #19761 Change-Id: Ie8d4f702f4f671666b120b332378644f094e288b Reviewed-on: https://go-review.googlesource.com/67430 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 25 Jun, 2018 1 commit
-
-
Guilherme Goncalves authored
Beginning on Go 1.9, ServeMux has been dropping the port number from the Host header and in the path pattern. This commit explicitly mentions the change in behavior and adds a simple test case to ensure consistency. Fixes #23351. Change-Id: I0270c8bd96cda92c13ac6437cdf66c2807b3042d Reviewed-on: https://go-review.googlesource.com/120557 Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 21 Jun, 2018 1 commit
-
-
Emmanuel T Odeke authored
CL 96575 introduced concurrency protection for ServeMux.shouldRedirect with a read lock and deferred unlock. However, the change produced a noticeable regression. Instead add the suffix "RLocked" to the function name to declare that we should hold the read lock as a pre-requisite before calling it, hence avoiding the defer altogether. Benchmarks: name old time/op new time/op delta ServeMux-8 63.3µs ± 0% 54.6µs ± 0% -13.74% (p=0.000 n=9+9) ServeMux_SkipServe-8 41.4µs ± 2% 32.7µs ± 1% -21.05% (p=0.000 n=10+10) name old alloc/op new alloc/op delta ServeMux-8 17.3kB ± 0% 17.3kB ± 0% ~ (all equal) ServeMux_SkipServe-8 0.00B 0.00B ~ (all equal) name old allocs/op new allocs/op delta ServeMux-8 360 ± 0% 360 ± 0% ~ (all equal) ServeMux_SkipServe-8 0.00 0.00 ~ (all equal) Updates #25383 Updates #25482 Change-Id: I2ffa4eafe165faa961ce23bd29b5653a89facbc2 Reviewed-on: https://go-review.googlesource.com/113996 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Brad Fitzpatrick <bradfitz@golang.org>
-
- 15 Jun, 2018 2 commits
-
-
Brad Fitzpatrick authored
Second try. The previous version (CL 115039 in git rev 39888635) wasn't accurate. Fixes #22347 Change-Id: I473165f308c730f50b14ba787cb215f7cb9ea364 Reviewed-on: https://go-review.googlesource.com/119235 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-
Brad Fitzpatrick authored
Fixes #24803 Change-Id: I8b1e7c5a74018a0c333f8c38a7ec5f5827ab1606 Reviewed-on: https://go-review.googlesource.com/106715 Reviewed-by:
Emmanuel Odeke <emm.odeke@gmail.com>
-
- 06 Jun, 2018 1 commit
-
-
Brad Fitzpatrick authored
Also, add a benchmark variant ("SkipServe") that only benchmarks the ServeMux handler selection path. name old time/op new time/op delta ServeMux_SkipServe-4 74.2µs ± 2% 60.6µs ± 1% -18.31% (p=0.000 n=10+9) name old alloc/op new alloc/op delta ServeMux_SkipServe-4 2.62kB ± 0% 0.00kB ±NaN% -100.00% (p=0.000 n=10+10) name old allocs/op new allocs/op delta ServeMux_SkipServe-4 180 ± 0% 0 ±NaN% -100.00% (p=0.000 n=10+10) Updates #25383 Change-Id: Icfbb3b977e309093d032e922d1b4f254df6f5955 Reviewed-on: https://go-review.googlesource.com/116378 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by:
Emmanuel Odeke <emm.odeke@gmail.com>
-
- 01 Jun, 2018 1 commit
-
-
Tim Cooper authored
Each URL was manually verified to ensure it did not serve up incorrect content. Change-Id: I4dc846227af95a73ee9a3074d0c379ff0fa955df Reviewed-on: https://go-review.googlesource.com/115798 Reviewed-by:
Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org>
-
- 29 May, 2018 1 commit
-
-
Brad Fitzpatrick authored
Fixes #23450 Change-Id: I829399194299d2e6d5e754b60e8f72b321b5da90 Reviewed-on: https://go-review.googlesource.com/115040 Reviewed-by:
Ian Lance Taylor <iant@golang.org>
-