aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/export_test.go
AgeCommit message (Collapse)Author
2015-11-19net/http: start of making all relevant tests test both http1 and http2Brad Fitzpatrick
This CL adds skipped failing tests, showing differences between HTTP/1 and HTTP/2 behavior. They'll be fixed in later commits. Only a tiny fraction of the net/http tests have been split into their "_h1" and "_h2" variants. That will also continue. (help welcome) Updates #6891 Updates #13315 Updates #13316 Updates #13317 Change-Id: I16c3c381dbe267a3098fb266ab0d804c36473a64 Reviewed-on: https://go-review.googlesource.com/17046 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Andrew Gerrand <adg@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-11-04net/http: register HTTP/2 before listening in ListenAndServeBrad Fitzpatrick
Change-Id: Icf9b6802945051aa484fb9ebcce71704f5655474 Reviewed-on: https://go-review.googlesource.com/16630 Reviewed-by: Andrew Gerrand <adg@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-10-19net/http: use the correct error variable in serveFileBrad Fitzpatrick
It was generating the wrong error message, always defaulting to "500 Internal Server Error", since the err variable used was always nil. Fixes #12991 Change-Id: I94b0e516409c131ff3b878bcb91e65f0259ff077 Reviewed-on: https://go-review.googlesource.com/16060 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2015-05-01net/http: fix scheduling race resulting in flaky testBrad Fitzpatrick
The test was measuring something, assuming other goroutines had already scheduled. Fixes #10427 Change-Id: I2a4d3906f9d4b5ea44b57d972e303bbe2b0b1cde Reviewed-on: https://go-review.googlesource.com/9561 Reviewed-by: David Crawshaw <crawshaw@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-22net/http: fix race between dialing and cancelingDaniel Morsing
In the brief window between getConn and persistConn.roundTrip, a cancel could end up going missing. Fix by making it possible to inspect if a cancel function was cleared and checking if we were canceled before entering roundTrip. Fixes #10511 Change-Id: If6513e63fbc2edb703e36d6356ccc95a1dc33144 Reviewed-on: https://go-review.googlesource.com/9181 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-20net/http: fix Transport data race, double cancel panic, cancel error messageBrad Fitzpatrick
Fixes #9496 Fixes #9946 Fixes #10474 Fixes #10405 Change-Id: I4e65f1706e46499811d9ebf4ad6d83a5dfb2ddaa Reviewed-on: https://go-review.googlesource.com/8550 Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-09net/http: handle close/response race more gracefullyDaniel Morsing
There was a logical race in Transport.RoundTrip where a roundtrip with a pending response would race with the channel for the connection closing. This usually happened for responses with connection: close and no body. We handled this race by reading the close channel, setting a timer for 100ms and if no response was returned before then, we would then return an error. This put a lower bound on how fast a connection could fail. We couldn't fail a request faster than 100ms. Reordering the channel operations gets rid of the logical race. If the readLoop causes the connection to be closed, it would have put its response into the return channel already and we can fetch it with a non-blocking receive. Change-Id: Idf09e48d7a0453d7de0120d3055d0ce5893a5428 Reviewed-on: https://go-review.googlesource.com/1787 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-10-07net/http: fix authentication info leakage in Referer header (potential ↵Jens Frederich
security risk) http.Client calls URL.String() to fill in the Referer header, which may contain authentication info. This patch removes authentication info from the Referer header without introducing any API changes. A new test for net/http is also provided. This is the polished version of Alberto García Hierro's https://golang.org/cl/9766046/ It should handle https Referer right. Fixes #8417 LGTM=bradfitz R=golang-codereviews, gobot, bradfitz, mikioh.mikioh CC=golang-codereviews https://golang.org/cl/151430043
2014-09-29net/http: make Transport.CloseIdleConnections also close pending dialsBrad Fitzpatrick
See comment 4 of https://code.google.com/p/go/issues/detail?id=8483#c4: "So if a user creates a http.Client, issues a bunch of requests and then wants to shutdown it and all opened connections; what is she intended to do? The report suggests that just waiting for all pending requests and calling CloseIdleConnections won't do, as there can be new racing connections. Obviously she can't do what you've done in the test, as it uses the unexported function. If this happens periodically, it can lead to serious resource leaks (the transport is also preserved alive). Am I missing something?" This CL tracks the user's intention to close all idle connections (CloseIdleConnections sets it true; and making a new request sets it false). If a pending dial finishes and nobody wants it, before it's retained for a future caller, the "wantIdle" bool is checked and it's closed if the user has called CloseIdleConnections without a later call to make a new request. Fixes #8483 LGTM=adg R=golang-codereviews, dvyukov, adg CC=golang-codereviews, rsc https://golang.org/cl/148970043
2014-09-24net/http: check for CloseWrite interface, not TCPConn implementationBrad Fitzpatrick
Fixes #8724 LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/148040043
2014-09-24net/http: support https_proxy in ProxyFromEnvironmentBrad Fitzpatrick
Fixes #6181 LGTM=adg R=adg CC=golang-codereviews https://golang.org/cl/148980043
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.