var hostPortHandler …
type testCloseConn …
func (c *testCloseConn) Close() error { … }
type testConnSet …
func (tcs *testConnSet) insert(c net.Conn) { … }
func (tcs *testConnSet) remove(c net.Conn) { … }
func makeTestDial(t *testing.T) (*testConnSet, func(n, addr string) (net.Conn, error)) { … }
func (tcs *testConnSet) check(t *testing.T) { … }
func TestReuseRequest(t *testing.T) { … }
func testReuseRequest(t *testing.T, mode testMode) { … }
func TestTransportKeepAlives(t *testing.T) { … }
func testTransportKeepAlives(t *testing.T, mode testMode) { … }
func TestTransportConnectionCloseOnResponse(t *testing.T) { … }
func testTransportConnectionCloseOnResponse(t *testing.T, mode testMode) { … }
func TestTransportConnectionCloseOnRequest(t *testing.T) { … }
func testTransportConnectionCloseOnRequest(t *testing.T, mode testMode) { … }
func TestTransportConnectionCloseOnRequestDisableKeepAlive(t *testing.T) { … }
func testTransportConnectionCloseOnRequestDisableKeepAlive(t *testing.T, mode testMode) { … }
func TestTransportRespectRequestWantsClose(t *testing.T) { … }
func testTransportRespectRequestWantsClose(t *testing.T, mode testMode) { … }
func TestTransportIdleCacheKeys(t *testing.T) { … }
func testTransportIdleCacheKeys(t *testing.T, mode testMode) { … }
func TestTransportReadToEndReusesConn(t *testing.T) { … }
func testTransportReadToEndReusesConn(t *testing.T, mode testMode) { … }
func TestTransportMaxPerHostIdleConns(t *testing.T) { … }
func testTransportMaxPerHostIdleConns(t *testing.T, mode testMode) { … }
func TestTransportMaxConnsPerHostIncludeDialInProgress(t *testing.T) { … }
func testTransportMaxConnsPerHostIncludeDialInProgress(t *testing.T, mode testMode) { … }
func TestTransportMaxConnsPerHost(t *testing.T) { … }
func testTransportMaxConnsPerHost(t *testing.T, mode testMode) { … }
func TestTransportMaxConnsPerHostDialCancellation(t *testing.T) { … }
func testTransportMaxConnsPerHostDialCancellation(t *testing.T, mode testMode) { … }
func TestTransportRemovesDeadIdleConnections(t *testing.T) { … }
func testTransportRemovesDeadIdleConnections(t *testing.T, mode testMode) { … }
func TestTransportServerClosingUnexpectedly(t *testing.T) { … }
func testTransportServerClosingUnexpectedly(t *testing.T, mode testMode) { … }
func TestStressSurpriseServerCloses(t *testing.T) { … }
func testStressSurpriseServerCloses(t *testing.T, mode testMode) { … }
func TestTransportHeadResponses(t *testing.T) { … }
func testTransportHeadResponses(t *testing.T, mode testMode) { … }
func TestTransportHeadChunkedResponse(t *testing.T) { … }
func testTransportHeadChunkedResponse(t *testing.T, mode testMode) { … }
var roundTripTests …
func TestRoundTripGzip(t *testing.T) { … }
func testRoundTripGzip(t *testing.T, mode testMode) { … }
func TestTransportGzip(t *testing.T) { … }
func testTransportGzip(t *testing.T, mode testMode) { … }
type transport100ContinueTest …
const transport100ContinueTestBody …
func newTransport100ContinueTest(t *testing.T, timeout time.Duration) *transport100ContinueTest { … }
func (test *transport100ContinueTest) respond(lines ...string) { … }
func (test *transport100ContinueTest) wantBodySent() { … }
func (test *transport100ContinueTest) wantRequestDone(want int) { … }
func TestTransportExpect100ContinueSent(t *testing.T) { … }
func TestTransportExpect100Continue200ResponseNoConnClose(t *testing.T) { … }
func TestTransportExpect100Continue200ResponseWithConnClose(t *testing.T) { … }
func TestTransportExpect100Continue500ResponseNoConnClose(t *testing.T) { … }
func TestTransportExpect100Continue500ResponseTimeout(t *testing.T) { … }
func TestSOCKS5Proxy(t *testing.T) { … }
func testSOCKS5Proxy(t *testing.T, mode testMode) { … }
func TestTransportProxy(t *testing.T) { … }
func TestOnProxyConnectResponse(t *testing.T) { … }
func TestTransportProxyHTTPSConnectLeak(t *testing.T) { … }
func TestTransportDialPreservesNetOpProxyError(t *testing.T) { … }
func TestTransportProxyDialDoesNotMutateProxyConnectHeader(t *testing.T) { … }
func testTransportProxyDialDoesNotMutateProxyConnectHeader(t *testing.T, mode testMode) { … }
func TestTransportGzipRecursive(t *testing.T) { … }
func testTransportGzipRecursive(t *testing.T, mode testMode) { … }
func TestTransportGzipShort(t *testing.T) { … }
func testTransportGzipShort(t *testing.T, mode testMode) { … }
func waitNumGoroutine(nmax int) int { … }
func TestTransportPersistConnLeak(t *testing.T) { … }
func testTransportPersistConnLeak(t *testing.T, mode testMode) { … }
func TestTransportPersistConnLeakShortBody(t *testing.T) { … }
func testTransportPersistConnLeakShortBody(t *testing.T, mode testMode) { … }
type countedConn …
type countingDialer …
func (d *countingDialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { … }
func (d *countingDialer) decrement(*countedConn) { … }
func (d *countingDialer) Read() (total, live int64) { … }
func TestTransportPersistConnLeakNeverIdle(t *testing.T) { … }
func testTransportPersistConnLeakNeverIdle(t *testing.T, mode testMode) { … }
type countedContext …
type contextCounter …
func (cc *contextCounter) Track(ctx context.Context) context.Context { … }
func (cc *contextCounter) decrement(*countedContext) { … }
func (cc *contextCounter) Read() (live int64) { … }
func TestTransportPersistConnContextLeakMaxConnsPerHost(t *testing.T) { … }
func testTransportPersistConnContextLeakMaxConnsPerHost(t *testing.T, mode testMode) { … }
func TestTransportIdleConnCrash(t *testing.T) { … }
func testTransportIdleConnCrash(t *testing.T, mode testMode) { … }
func TestIssue3644(t *testing.T) { … }
func testIssue3644(t *testing.T, mode testMode) { … }
func TestIssue3595(t *testing.T) { … }
func testIssue3595(t *testing.T, mode testMode) { … }
func TestChunkedNoContent(t *testing.T) { … }
func testChunkedNoContent(t *testing.T, mode testMode) { … }
func TestTransportConcurrency(t *testing.T) { … }
func testTransportConcurrency(t *testing.T, mode testMode) { … }
func TestIssue4191_InfiniteGetTimeout(t *testing.T) { … }
func testIssue4191_InfiniteGetTimeout(t *testing.T, mode testMode) { … }
func TestIssue4191_InfiniteGetToPutTimeout(t *testing.T) { … }
func testIssue4191_InfiniteGetToPutTimeout(t *testing.T, mode testMode) { … }
func TestTransportResponseHeaderTimeout(t *testing.T) { … }
func testTransportResponseHeaderTimeout(t *testing.T, mode testMode) { … }
type cancelTest …
func runCancelTestTransport(t *testing.T, mode testMode, f func(t *testing.T, test cancelTest)) { … }
func runCancelTestChannel(t *testing.T, mode testMode, f func(t *testing.T, test cancelTest)) { … }
func runCancelTestContext(t *testing.T, mode testMode, f func(t *testing.T, test cancelTest)) { … }
func runCancelTest(t *testing.T, f func(t *testing.T, test cancelTest), opts ...any) { … }
func TestTransportCancelRequest(t *testing.T) { … }
func testTransportCancelRequest(t *testing.T, test cancelTest) { … }
func testTransportCancelRequestInDo(t *testing.T, test cancelTest, body io.Reader) { … }
func TestTransportCancelRequestInDo(t *testing.T) { … }
func TestTransportCancelRequestWithBodyInDo(t *testing.T) { … }
func TestTransportCancelRequestInDial(t *testing.T) { … }
func testTransportCancelRequestInDial(t *testing.T, test cancelTest) { … }
func TestTransportCancelRequestWithBody(t *testing.T) { … }
func testTransportCancelRequestWithBody(t *testing.T, test cancelTest) { … }
func TestTransportCancelRequestBeforeDo(t *testing.T) { … }
func testTransportCancelRequestBeforeDo(t *testing.T, test cancelTest) { … }
func TestTransportCancelRequestBeforeResponseHeaders(t *testing.T) { … }
func testTransportCancelRequestBeforeResponseHeaders(t *testing.T, test cancelTest) { … }
func TestTransportCloseResponseBody(t *testing.T) { … }
func testTransportCloseResponseBody(t *testing.T, mode testMode) { … }
type fooProto …
func (fooProto) RoundTrip(req *Request) (*Response, error) { … }
func TestTransportAltProto(t *testing.T) { … }
func TestTransportNoHost(t *testing.T) { … }
func TestTransportEmptyMethod(t *testing.T) { … }
func TestTransportSocketLateBinding(t *testing.T) { … }
func testTransportSocketLateBinding(t *testing.T, mode testMode) { … }
func TestTransportReading100Continue(t *testing.T) { … }
func TestTransportIgnore1xxResponses(t *testing.T) { … }
func testTransportIgnore1xxResponses(t *testing.T, mode testMode) { … }
func TestTransportLimits1xxResponses(t *testing.T) { … }
func testTransportLimits1xxResponses(t *testing.T, mode testMode) { … }
func TestTransportDoesNotLimitDelivered1xxResponses(t *testing.T) { … }
func testTransportDoesNotLimitDelivered1xxResponses(t *testing.T, mode testMode) { … }
func TestTransportTreat101Terminal(t *testing.T) { … }
func testTransportTreat101Terminal(t *testing.T, mode testMode) { … }
type proxyFromEnvTest …
func (t proxyFromEnvTest) String() string { … }
var proxyFromEnvTests …
func testProxyForRequest(t *testing.T, tt proxyFromEnvTest, proxyForRequest func(req *Request) (*url.URL, error)) { … }
func TestProxyFromEnvironment(t *testing.T) { … }
func TestProxyFromEnvironmentLowerCase(t *testing.T) { … }
func TestIdleConnChannelLeak(t *testing.T) { … }
func testIdleConnChannelLeak(t *testing.T, mode testMode) { … }
func TestTransportClosesRequestBody(t *testing.T) { … }
func testTransportClosesRequestBody(t *testing.T, mode testMode) { … }
func TestTransportTLSHandshakeTimeout(t *testing.T) { … }
func TestTLSServerClosesConnection(t *testing.T) { … }
func testTLSServerClosesConnection(t *testing.T, mode testMode) { … }
type byteFromChanReader …
func (c byteFromChanReader) Read(p []byte) (n int, err error) { … }
func TestTransportNoReuseAfterEarlyResponse(t *testing.T) { … }
func testTransportNoReuseAfterEarlyResponse(t *testing.T, mode testMode) { … }
func TestTransportIssue10457(t *testing.T) { … }
func testTransportIssue10457(t *testing.T, mode testMode) { … }
type closerFunc …
func (f closerFunc) Close() error { … }
type writerFuncConn …
func (c writerFuncConn) Write(p []byte) (n int, err error) { … }
func TestRetryRequestsOnError(t *testing.T) { … }
func testRetryRequestsOnError(t *testing.T, mode testMode) { … }
func TestTransportClosesBodyOnError(t *testing.T) { … }
func testTransportClosesBodyOnError(t *testing.T, mode testMode) { … }
func TestTransportDialTLS(t *testing.T) { … }
func testTransportDialTLS(t *testing.T, mode testMode) { … }
func TestTransportDialContext(t *testing.T) { … }
func testTransportDialContext(t *testing.T, mode testMode) { … }
func TestTransportDialTLSContext(t *testing.T) { … }
func testTransportDialTLSContext(t *testing.T, mode testMode) { … }
func TestRoundTripReturnsProxyError(t *testing.T) { … }
func TestTransportCloseIdleConnsThenReturn(t *testing.T) { … }
func TestTransportTraceGotConnH2IdleConns(t *testing.T) { … }
func TestTransportRemovesH2ConnsAfterIdle(t *testing.T) { … }
func testTransportRemovesH2ConnsAfterIdle(t *testing.T, mode testMode) { … }
func TestTransportRangeAndGzip(t *testing.T) { … }
func testTransportRangeAndGzip(t *testing.T, mode testMode) { … }
func TestTransportResponseCancelRace(t *testing.T) { … }
func testTransportResponseCancelRace(t *testing.T, mode testMode) { … }
func TestTransportContentEncodingCaseInsensitive(t *testing.T) { … }
func testTransportContentEncodingCaseInsensitive(t *testing.T, mode testMode) { … }
func TestConnClosedBeforeRequestIsWritten(t *testing.T) { … }
func testConnClosedBeforeRequestIsWritten(t *testing.T, mode testMode) { … }
type logWritesConn …
func (c *logWritesConn) Write(p []byte) (n int, err error) { … }
func (c *logWritesConn) Read(p []byte) (n int, err error) { … }
func (c *logWritesConn) Close() error { … }
func TestTransportFlushesBodyChunks(t *testing.T) { … }
func TestTransportFlushesRequestHeader(t *testing.T) { … }
func testTransportFlushesRequestHeader(t *testing.T, mode testMode) { … }
type wgReadCloser …
func (c *wgReadCloser) Close() error { … }
func TestTransportPrefersResponseOverWriteError(t *testing.T) { … }
func testTransportPrefersResponseOverWriteError(t *testing.T, mode testMode) { … }
func TestTransportAutomaticHTTP2(t *testing.T) { … }
func TestTransportAutomaticHTTP2_DialerAndTLSConfigSupportsHTTP2AndTLSConfig(t *testing.T) { … }
func TestTransportAutomaticHTTP2_DefaultTransport(t *testing.T) { … }
func TestTransportAutomaticHTTP2_TLSNextProto(t *testing.T) { … }
func TestTransportAutomaticHTTP2_TLSConfig(t *testing.T) { … }
func TestTransportAutomaticHTTP2_ExpectContinueTimeout(t *testing.T) { … }
func TestTransportAutomaticHTTP2_Dial(t *testing.T) { … }
func TestTransportAutomaticHTTP2_DialContext(t *testing.T) { … }
func TestTransportAutomaticHTTP2_DialTLS(t *testing.T) { … }
func testTransportAutoHTTP(t *testing.T, tr *Transport, wantH2 bool) { … }
func TestTransportReuseConnEmptyResponseBody(t *testing.T) { … }
func testTransportReuseConnEmptyResponseBody(t *testing.T, mode testMode) { … }
func TestNoCrashReturningTransportAltConn(t *testing.T) { … }
func TestTransportReuseConnection_Gzip_Chunked(t *testing.T) { … }
func TestTransportReuseConnection_Gzip_ContentLength(t *testing.T) { … }
func testTransportReuseConnection_Gzip(t *testing.T, mode testMode, chunked bool) { … }
func TestTransportResponseHeaderLength(t *testing.T) { … }
func testTransportResponseHeaderLength(t *testing.T, mode testMode) { … }
func TestTransportEventTrace(t *testing.T) { … }
func TestTransportEventTrace_NoHooks(t *testing.T) { … }
func testTransportEventTrace(t *testing.T, mode testMode, noHooks bool) { … }
func TestTransportEventTraceTLSVerify(t *testing.T) { … }
func testTransportEventTraceTLSVerify(t *testing.T, mode testMode) { … }
var isDNSHijacked …
func skipIfDNSHijacked(t *testing.T) { … }
func TestTransportEventTraceRealDNS(t *testing.T) { … }
func TestTransportRejectsAlphaPort(t *testing.T) { … }
func TestTLSHandshakeTrace(t *testing.T) { … }
func testTLSHandshakeTrace(t *testing.T, mode testMode) { … }
func TestTransportMaxIdleConns(t *testing.T) { … }
func testTransportMaxIdleConns(t *testing.T, mode testMode) { … }
func TestTransportIdleConnTimeout(t *testing.T) { … }
func testTransportIdleConnTimeout(t *testing.T, mode testMode) { … }
func TestIdleConnH2Crash(t *testing.T) { … }
func testIdleConnH2Crash(t *testing.T, mode testMode) { … }
type funcConn …
func (c funcConn) Read(p []byte) (int, error) { … }
func (c funcConn) Write(p []byte) (int, error) { … }
func (c funcConn) Close() error { … }
func TestTransportReturnsPeekError(t *testing.T) { … }
func TestTransportIDNA(t *testing.T) { … }
func testTransportIDNA(t *testing.T, mode testMode) { … }
func TestTransportProxyConnectHeader(t *testing.T) { … }
func testTransportProxyConnectHeader(t *testing.T, mode testMode) { … }
func TestTransportProxyGetConnectHeader(t *testing.T) { … }
func testTransportProxyGetConnectHeader(t *testing.T, mode testMode) { … }
var errFakeRoundTrip …
type funcRoundTripper …
func (fn funcRoundTripper) RoundTrip(*Request) (*Response, error) { … }
func wantBody(res *Response, err error, want string) error { … }
func newLocalListener(t *testing.T) net.Listener { … }
type countCloseReader …
func (cr countCloseReader) Close() error { … }
var rgz …
func TestMissingStatusNoPanic(t *testing.T) { … }
func doFetchCheckPanic(tr *Transport, req *Request) (res *Response, err error, panicked bool) { … }
func TestNoBodyOnChunked304Response(t *testing.T) { … }
func testNoBodyOnChunked304Response(t *testing.T, mode testMode) { … }
type funcWriter …
func (f funcWriter) Write(p []byte) (int, error) { … }
type doneContext …
func (doneContext) Done() <-chan struct{ … }
func (d doneContext) Err() error { … }
func TestTransportCheckContextDoneEarly(t *testing.T) { … }
func TestClientTimeoutKillsConn_BeforeHeaders(t *testing.T) { … }
func testClientTimeoutKillsConn_BeforeHeaders(t *testing.T, mode testMode) { … }
func TestClientTimeoutKillsConn_AfterHeaders(t *testing.T) { … }
func testClientTimeoutKillsConn_AfterHeaders(t *testing.T, mode testMode) { … }
func TestTransportResponseBodyWritableOnProtocolSwitch(t *testing.T) { … }
func testTransportResponseBodyWritableOnProtocolSwitch(t *testing.T, mode testMode) { … }
func TestTransportCONNECTBidi(t *testing.T) { … }
func testTransportCONNECTBidi(t *testing.T, mode testMode) { … }
func TestTransportRequestReplayable(t *testing.T) { … }
type testMockTCPConn …
func (c *testMockTCPConn) ReadFrom(r io.Reader) (int64, error) { … }
func TestTransportRequestWriteRoundTrip(t *testing.T) { … }
func testTransportRequestWriteRoundTrip(t *testing.T, mode testMode) { … }
func TestTransportClone(t *testing.T) { … }
func TestIs408(t *testing.T) { … }
func TestTransportIgnores408(t *testing.T) { … }
func testTransportIgnores408(t *testing.T, mode testMode) { … }
func TestInvalidHeaderResponse(t *testing.T) { … }
func testInvalidHeaderResponse(t *testing.T, mode testMode) { … }
type bodyCloser …
func (bc *bodyCloser) Close() error { … }
func (bc *bodyCloser) Read(b []byte) (n int, err error) { … }
func TestTransportClosesBodyOnInvalidRequests(t *testing.T) { … }
func testTransportClosesBodyOnInvalidRequests(t *testing.T, mode testMode) { … }
type breakableConn …
type brokenState …
func (w *breakableConn) Write(b []byte) (n int, err error) { … }
func TestDontCacheBrokenHTTP2Conn(t *testing.T) { … }
func testDontCacheBrokenHTTP2Conn(t *testing.T, mode testMode) { … }
func TestTransportDecrementConnWhenIdleConnRemoved(t *testing.T) { … }
func testTransportDecrementConnWhenIdleConnRemoved(t *testing.T, mode testMode) { … }
func TestAltProtoCancellation(t *testing.T) { … }
var errCancelProto …
type cancelProto …
func (cancelProto) RoundTrip(req *Request) (*Response, error) { … }
type roundTripFunc …
func (f roundTripFunc) RoundTrip(r *Request) (*Response, error) { … }
func TestIssue32441(t *testing.T) { … }
func testIssue32441(t *testing.T, mode testMode) { … }
func TestTransportRejectsSignInContentLength(t *testing.T) { … }
func testTransportRejectsSignInContentLength(t *testing.T, mode testMode) { … }
type dumpConn …
func (c *dumpConn) Close() error { … }
func (c *dumpConn) LocalAddr() net.Addr { … }
func (c *dumpConn) RemoteAddr() net.Addr { … }
func (c *dumpConn) SetDeadline(t time.Time) error { … }
func (c *dumpConn) SetReadDeadline(t time.Time) error { … }
func (c *dumpConn) SetWriteDeadline(t time.Time) error { … }
type delegateReader …
func (r *delegateReader) Read(p []byte) (int, error) { … }
func testTransportRace(req *Request) { … }
func TestErrorWriteLoopRace(t *testing.T) { … }
func TestCancelRequestWhenSharingConnection(t *testing.T) { … }
func testCancelRequestWhenSharingConnection(t *testing.T, mode testMode) { … }
func TestHandlerAbortRacesBodyRead(t *testing.T) { … }
func testHandlerAbortRacesBodyRead(t *testing.T, mode testMode) { … }
func TestRequestSanitization(t *testing.T) { … }
func testRequestSanitization(t *testing.T, mode testMode) { … }
func TestProxyAuthHeader(t *testing.T) { … }
func testProxyAuthHeader(t *testing.T, mode testMode) { … }
func TestTransportReqCancelerCleanupOnRequestBodyWriteError(t *testing.T) { … }
func TestValidateClientRequestTrailers(t *testing.T) { … }
func testValidateClientRequestTrailers(t *testing.T, mode testMode) { … }