type dummyAddr …
type oneConnListener …
func (l *oneConnListener) Accept() (c net.Conn, err error) { … }
func (l *oneConnListener) Close() error { … }
func (l *oneConnListener) Addr() net.Addr { … }
func (a dummyAddr) Network() string { … }
func (a dummyAddr) String() string { … }
type noopConn …
func (noopConn) LocalAddr() net.Addr { … }
func (noopConn) RemoteAddr() net.Addr { … }
func (noopConn) SetDeadline(t time.Time) error { … }
func (noopConn) SetReadDeadline(t time.Time) error { … }
func (noopConn) SetWriteDeadline(t time.Time) error { … }
type rwTestConn …
func (c *rwTestConn) Close() error { … }
type testConn …
func newTestConn() *testConn { … }
func (c *testConn) Read(b []byte) (int, error) { … }
func (c *testConn) Write(b []byte) (int, error) { … }
func (c *testConn) Close() error { … }
func reqBytes(req string) []byte { … }
type handlerTest …
func newHandlerTest(h Handler) handlerTest { … }
func (ht *handlerTest) rawResponse(req string) string { … }
func TestConsumingBodyOnNextConn(t *testing.T) { … }
type stringHandler …
func (s stringHandler) ServeHTTP(w ResponseWriter, r *Request) { … }
var handlers …
var vtests …
func TestHostHandlers(t *testing.T) { … }
func testHostHandlers(t *testing.T, mode testMode) { … }
var serveMuxRegister …
func serve(code int) HandlerFunc { … }
func checkQueryStringHandler(w ResponseWriter, r *Request) { … }
var serveMuxTests …
func TestServeMuxHandler(t *testing.T) { … }
func TestServeMuxHandleFuncWithNilHandler(t *testing.T) { … }
var serveMuxTests2 …
func TestServeMuxHandlerRedirects(t *testing.T) { … }
func TestMuxRedirectLeadingSlashes(t *testing.T) { … }
func TestServeWithSlashRedirectKeepsQueryString(t *testing.T) { … }
func testServeWithSlashRedirectKeepsQueryString(t *testing.T, mode testMode) { … }
func TestServeWithSlashRedirectForHostPatterns(t *testing.T) { … }
func TestMuxNoSlashRedirectWithTrailingSlash(t *testing.T) { … }
func TestMuxNoSlash405WithTrailingSlash(t *testing.T) { … }
func TestShouldRedirectConcurrency(t *testing.T) { … }
func testShouldRedirectConcurrency(t *testing.T, mode testMode) { … }
func BenchmarkServeMux(b *testing.B) { … }
func BenchmarkServeMux_SkipServe(b *testing.B) { … }
func benchmarkServeMux(b *testing.B, runHandler bool) { … }
func TestServerTimeouts(t *testing.T) { … }
func testServerTimeouts(t *testing.T, mode testMode) { … }
func testServerTimeoutsWithTimeout(t *testing.T, timeout time.Duration, mode testMode) error { … }
func TestServerReadTimeout(t *testing.T) { … }
func testServerReadTimeout(t *testing.T, mode testMode) { … }
func TestServerNoReadTimeout(t *testing.T) { … }
func testServerNoReadTimeout(t *testing.T, mode testMode) { … }
func TestServerWriteTimeout(t *testing.T) { … }
func testServerWriteTimeout(t *testing.T, mode testMode) { … }
func TestServerNoWriteTimeout(t *testing.T) { … }
func testServerNoWriteTimeout(t *testing.T, mode testMode) { … }
func TestWriteDeadlineExtendedOnNewRequest(t *testing.T) { … }
func testWriteDeadlineExtendedOnNewRequest(t *testing.T, mode testMode) { … }
func tryTimeouts(t *testing.T, testFunc func(timeout time.Duration) error) { … }
func TestWriteDeadlineEnforcedPerStream(t *testing.T) { … }
func testWriteDeadlineEnforcedPerStream(t *testing.T, mode testMode, timeout time.Duration) error { … }
func TestNoWriteDeadline(t *testing.T) { … }
func testNoWriteDeadline(t *testing.T, mode testMode, timeout time.Duration) error { … }
func TestOnlyWriteTimeout(t *testing.T) { … }
func testOnlyWriteTimeout(t *testing.T, mode testMode) { … }
type trackLastConnListener …
func (l trackLastConnListener) Accept() (c net.Conn, err error) { … }
func TestIdentityResponse(t *testing.T) { … }
func testIdentityResponse(t *testing.T, mode testMode) { … }
func testTCPConnectionCloses(t *testing.T, req string, h Handler) { … }
func testTCPConnectionStaysOpen(t *testing.T, req string, handler Handler) { … }
func TestServeHTTP10Close(t *testing.T) { … }
func TestClientCanClose(t *testing.T) { … }
func TestHandlersCanSetConnectionClose11(t *testing.T) { … }
func TestHandlersCanSetConnectionClose10(t *testing.T) { … }
func TestHTTP2UpgradeClosesConnection(t *testing.T) { … }
func send204(w ResponseWriter, r *Request) { … }
func send304(w ResponseWriter, r *Request) { … }
func TestHTTP10KeepAlive204Response(t *testing.T) { … }
func TestHTTP11KeepAlive204Response(t *testing.T) { … }
func TestHTTP10KeepAlive304Response(t *testing.T) { … }
func TestKeepAliveFinalChunkWithEOF(t *testing.T) { … }
func testKeepAliveFinalChunkWithEOF(t *testing.T, mode testMode) { … }
func TestSetsRemoteAddr(t *testing.T) { … }
func testSetsRemoteAddr(t *testing.T, mode testMode) { … }
type blockingRemoteAddrListener …
func (l *blockingRemoteAddrListener) Accept() (net.Conn, error) { … }
type blockingRemoteAddrConn …
func (c *blockingRemoteAddrConn) RemoteAddr() net.Addr { … }
func TestServerAllowsBlockingRemoteAddr(t *testing.T) { … }
func testServerAllowsBlockingRemoteAddr(t *testing.T, mode testMode) { … }
func TestHeadResponses(t *testing.T) { … }
func testHeadResponses(t *testing.T, mode testMode) { … }
func TestHeadReaderFrom(t *testing.T) { … }
func testHeadReaderFrom(t *testing.T, mode testMode) { … }
func TestTLSHandshakeTimeout(t *testing.T) { … }
func testTLSHandshakeTimeout(t *testing.T, mode testMode) { … }
func TestTLSServer(t *testing.T) { … }
func testTLSServer(t *testing.T, mode testMode) { … }
func TestServeTLS(t *testing.T) { … }
func TestTLSServerRejectHTTPRequests(t *testing.T) { … }
func testTLSServerRejectHTTPRequests(t *testing.T, mode testMode) { … }
func TestAutomaticHTTP2_Serve_NoTLSConfig(t *testing.T) { … }
func TestAutomaticHTTP2_Serve_NonH2TLSConfig(t *testing.T) { … }
func TestAutomaticHTTP2_Serve_H2TLSConfig(t *testing.T) { … }
func testAutomaticHTTP2_Serve(t *testing.T, tlsConf *tls.Config, wantH2 bool) { … }
func TestAutomaticHTTP2_Serve_WithTLSConfig(t *testing.T) { … }
func TestAutomaticHTTP2_ListenAndServe(t *testing.T) { … }
func TestAutomaticHTTP2_ListenAndServe_GetCertificate(t *testing.T) { … }
func TestAutomaticHTTP2_ListenAndServe_GetConfigForClient(t *testing.T) { … }
func testAutomaticHTTP2_ListenAndServe(t *testing.T, tlsConf *tls.Config) { … }
type serverExpectTest …
func expectTest(contentLength int, expectation string, readBody bool, expectedResponse string) serverExpectTest { … }
var serverExpectTests …
func TestServerExpect(t *testing.T) { … }
func testServerExpect(t *testing.T, mode testMode) { … }
func TestServerUnreadRequestBodyLittle(t *testing.T) { … }
func TestServerUnreadRequestBodyLarge(t *testing.T) { … }
type handlerBodyCloseTest …
func (t handlerBodyCloseTest) connectionHeader() string { … }
var handlerBodyCloseTests …
func TestHandlerBodyClose(t *testing.T) { … }
func testHandlerBodyClose(t *testing.T, i int, tt handlerBodyCloseTest) { … }
type testHandlerBodyConsumer …
var testHandlerBodyConsumers …
func TestRequestBodyReadErrorClosesConnection(t *testing.T) { … }
func TestInvalidTrailerClosesConnection(t *testing.T) { … }
type slowTestConn …
func (c *slowTestConn) SetDeadline(t time.Time) error { … }
func (c *slowTestConn) SetReadDeadline(t time.Time) error { … }
func (c *slowTestConn) SetWriteDeadline(t time.Time) error { … }
func (c *slowTestConn) Read(b []byte) (n int, err error) { … }
func (c *slowTestConn) Close() error { … }
func (c *slowTestConn) Write(b []byte) (int, error) { … }
func TestRequestBodyTimeoutClosesConnection(t *testing.T) { … }
type cancelableTimeoutContext …
func (c cancelableTimeoutContext) Err() error { … }
func TestTimeoutHandler(t *testing.T) { … }
func testTimeoutHandler(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerRace(t *testing.T) { … }
func testTimeoutHandlerRace(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerRaceHeader(t *testing.T) { … }
func testTimeoutHandlerRaceHeader(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerRaceHeaderTimeout(t *testing.T) { … }
func testTimeoutHandlerRaceHeaderTimeout(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerStartTimerWhenServing(t *testing.T) { … }
func testTimeoutHandlerStartTimerWhenServing(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerContextCanceled(t *testing.T) { … }
func testTimeoutHandlerContextCanceled(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerEmptyResponse(t *testing.T) { … }
func testTimeoutHandlerEmptyResponse(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerPanicRecovery(t *testing.T) { … }
func TestRedirectBadPath(t *testing.T) { … }
func TestRedirect(t *testing.T) { … }
func TestRedirectContentTypeAndBody(t *testing.T) { … }
func TestZeroLengthPostAndResponse(t *testing.T) { … }
func testZeroLengthPostAndResponse(t *testing.T, mode testMode) { … }
func TestHandlerPanicNil(t *testing.T) { … }
func TestHandlerPanic(t *testing.T) { … }
func TestHandlerPanicWithHijack(t *testing.T) { … }
func testHandlerPanic(t *testing.T, withHijack bool, mode testMode, wrapper func(Handler) Handler, panicValue any) { … }
type terrorWriter …
func (w terrorWriter) Write(p []byte) (int, error) { … }
func TestServerWriteHijackZeroBytes(t *testing.T) { … }
func testServerWriteHijackZeroBytes(t *testing.T, mode testMode) { … }
func TestServerNoDate(t *testing.T) { … }
func TestServerContentType(t *testing.T) { … }
func testServerNoHeader(t *testing.T, mode testMode, header string) { … }
func TestStripPrefix(t *testing.T) { … }
func testStripPrefix(t *testing.T, mode testMode) { … }
func TestStripPrefixNotModifyRequest(t *testing.T) { … }
func TestRequestLimit(t *testing.T) { … }
func testRequestLimit(t *testing.T, mode testMode) { … }
type neverEnding …
func (b neverEnding) Read(p []byte) (n int, err error) { … }
type bodyLimitReader …
func (r *bodyLimitReader) Read(p []byte) (int, error) { … }
func (r *bodyLimitReader) Close() error { … }
func TestRequestBodyLimit(t *testing.T) { … }
func testRequestBodyLimit(t *testing.T, mode testMode) { … }
func TestClientWriteShutdown(t *testing.T) { … }
func testClientWriteShutdown(t *testing.T, mode testMode) { … }
func TestServerBufferedChunking(t *testing.T) { … }
func TestServerGracefulClose(t *testing.T) { … }
func testServerGracefulClose(t *testing.T, mode testMode) { … }
func TestCaseSensitiveMethod(t *testing.T) { … }
func testCaseSensitiveMethod(t *testing.T, mode testMode) { … }
func TestContentLengthZero(t *testing.T) { … }
func testContentLengthZero(t *testing.T, mode testMode) { … }
func TestCloseNotifier(t *testing.T) { … }
func testCloseNotifier(t *testing.T, mode testMode) { … }
func TestCloseNotifierPipelined(t *testing.T) { … }
func testCloseNotifierPipelined(t *testing.T, mode testMode) { … }
func TestCloseNotifierChanLeak(t *testing.T) { … }
func TestHijackAfterCloseNotifier(t *testing.T) { … }
func testHijackAfterCloseNotifier(t *testing.T, mode testMode) { … }
func TestHijackBeforeRequestBodyRead(t *testing.T) { … }
func testHijackBeforeRequestBodyRead(t *testing.T, mode testMode) { … }
func TestOptions(t *testing.T) { … }
func testOptions(t *testing.T, mode testMode) { … }
func TestOptionsHandler(t *testing.T) { … }
func testOptionsHandler(t *testing.T, mode testMode) { … }
func TestHeaderToWire(t *testing.T) { … }
type errorListener …
func (l *errorListener) Accept() (c net.Conn, err error) { … }
func (l *errorListener) Close() error { … }
func (l *errorListener) Addr() net.Addr { … }
func TestAcceptMaxFds(t *testing.T) { … }
func TestWriteAfterHijack(t *testing.T) { … }
func TestDoubleHijack(t *testing.T) { … }
func TestHTTP10ConnectionHeader(t *testing.T) { … }
func testHTTP10ConnectionHeader(t *testing.T, mode testMode) { … }
func TestServerReaderFromOrder(t *testing.T) { … }
func testServerReaderFromOrder(t *testing.T, mode testMode) { … }
func TestCodesPreventingContentTypeAndBody(t *testing.T) { … }
func TestContentTypeOkayOn204(t *testing.T) { … }
func TestTransportAndServerSharedBodyRace(t *testing.T) { … }
func testTransportAndServerSharedBodyRace(t *testing.T, mode testMode) { … }
func TestRequestBodyCloseDoesntBlock(t *testing.T) { … }
func testRequestBodyCloseDoesntBlock(t *testing.T, mode testMode) { … }
func TestResponseWriterWriteString(t *testing.T) { … }
func TestAppendTime(t *testing.T) { … }
func TestServerConnState(t *testing.T) { … }
func testServerConnState(t *testing.T, mode testMode) { … }
func TestServerKeepAlivesEnabledResultClose(t *testing.T) { … }
func testServerKeepAlivesEnabledResultClose(t *testing.T, mode testMode) { … }
func TestServerEmptyBodyRace(t *testing.T) { … }
func testServerEmptyBodyRace(t *testing.T, mode testMode) { … }
func TestServerConnStateNew(t *testing.T) { … }
type closeWriteTestConn …
func (c *closeWriteTestConn) CloseWrite() error { … }
func TestCloseWrite(t *testing.T) { … }
func TestServerFlushAndHijack(t *testing.T) { … }
func testServerFlushAndHijack(t *testing.T, mode testMode) { … }
func TestServerKeepAliveAfterWriteError(t *testing.T) { … }
func testServerKeepAliveAfterWriteError(t *testing.T, mode testMode) { … }
func TestNoContentLengthIfTransferEncoding(t *testing.T) { … }
func testNoContentLengthIfTransferEncoding(t *testing.T, mode testMode) { … }
func TestTolerateCRLFBeforeRequestLine(t *testing.T) { … }
func TestIssue13893_Expect100(t *testing.T) { … }
func TestIssue11549_Expect100(t *testing.T) { … }
func TestHandlerFinishSkipBigContentLengthRead(t *testing.T) { … }
func TestHandlerSetsBodyNil(t *testing.T) { … }
func testHandlerSetsBodyNil(t *testing.T, mode testMode) { … }
func TestServerValidatesHostHeader(t *testing.T) { … }
func TestServerHandlersCanHandleH2PRI(t *testing.T) { … }
func testServerHandlersCanHandleH2PRI(t *testing.T, mode testMode) { … }
func TestServerValidatesHeaders(t *testing.T) { … }
func TestServerRequestContextCancel_ServeHTTPDone(t *testing.T) { … }
func testServerRequestContextCancel_ServeHTTPDone(t *testing.T, mode testMode) { … }
func TestServerRequestContextCancel_ConnClose(t *testing.T) { … }
func testServerRequestContextCancel_ConnClose(t *testing.T, mode testMode) { … }
func TestServerContext_ServerContextKey(t *testing.T) { … }
func testServerContext_ServerContextKey(t *testing.T, mode testMode) { … }
func TestServerContext_LocalAddrContextKey(t *testing.T) { … }
func testServerContext_LocalAddrContextKey(t *testing.T, mode testMode) { … }
func TestHandlerSetTransferEncodingChunked(t *testing.T) { … }
func TestHandlerSetTransferEncodingGzip(t *testing.T) { … }
func BenchmarkClientServer(b *testing.B) { … }
func benchmarkClientServer(b *testing.B, mode testMode) { … }
func BenchmarkClientServerParallel(b *testing.B) { … }
func benchmarkClientServerParallel(b *testing.B, parallelism int, mode testMode) { … }
func BenchmarkServer(b *testing.B) { … }
func getNoBody(urlStr string) (*Response, error) { … }
func BenchmarkClient(b *testing.B) { … }
func BenchmarkServerFakeConnNoKeepAlive(b *testing.B) { … }
type repeatReader …
func (r *repeatReader) Read(p []byte) (n int, err error) { … }
func BenchmarkServerFakeConnWithKeepAlive(b *testing.B) { … }
func BenchmarkServerFakeConnWithKeepAliveLite(b *testing.B) { … }
const someResponse …
var response …
func BenchmarkServerHandlerTypeLen(b *testing.B) { … }
func BenchmarkServerHandlerNoLen(b *testing.B) { … }
func BenchmarkServerHandlerNoType(b *testing.B) { … }
func BenchmarkServerHandlerNoHeader(b *testing.B) { … }
func benchmarkHandler(b *testing.B, h Handler) { … }
func BenchmarkServerHijack(b *testing.B) { … }
func BenchmarkCloseNotifier(b *testing.B) { … }
func benchmarkCloseNotifier(b *testing.B, mode testMode) { … }
func TestConcurrentServerServe(t *testing.T) { … }
func TestServerIdleTimeout(t *testing.T) { … }
func testServerIdleTimeout(t *testing.T, mode testMode) { … }
func get(t *testing.T, c *Client, url string) string { … }
func TestServerSetKeepAlivesEnabledClosesConns(t *testing.T) { … }
func testServerSetKeepAlivesEnabledClosesConns(t *testing.T, mode testMode) { … }
func TestServerShutdown(t *testing.T) { … }
func testServerShutdown(t *testing.T, mode testMode) { … }
func TestServerShutdownStateNew(t *testing.T) { … }
func testServerShutdownStateNew(t *testing.T, mode testMode) { … }
func TestServerCloseDeadlock(t *testing.T) { … }
func TestServerKeepAlivesEnabled(t *testing.T) { … }
func testServerKeepAlivesEnabled(t *testing.T, mode testMode) { … }
func TestServerCancelsReadTimeoutWhenIdle(t *testing.T) { … }
func testServerCancelsReadTimeoutWhenIdle(t *testing.T, mode testMode) { … }
func TestServerCancelsReadHeaderTimeoutWhenIdle(t *testing.T) { … }
func testServerCancelsReadHeaderTimeoutWhenIdle(t *testing.T, mode testMode) { … }
func runTimeSensitiveTest(t *testing.T, durations []time.Duration, test func(t *testing.T, d time.Duration) error) { … }
func TestServerDuplicateBackgroundRead(t *testing.T) { … }
func testServerDuplicateBackgroundRead(t *testing.T, mode testMode) { … }
func TestServerHijackGetsBackgroundByte(t *testing.T) { … }
func testServerHijackGetsBackgroundByte(t *testing.T, mode testMode) { … }
func TestServerHijackGetsBackgroundByte_big(t *testing.T) { … }
func testServerHijackGetsBackgroundByte_big(t *testing.T, mode testMode) { … }
func TestServerValidatesMethod(t *testing.T) { … }
type eofListenerNotComparable …
func (eofListenerNotComparable) Accept() (net.Conn, error) { … }
func (eofListenerNotComparable) Addr() net.Addr { … }
func (eofListenerNotComparable) Close() error { … }
func TestServerListenNotComparableListener(t *testing.T) { … }
type countCloseListener …
func (p *countCloseListener) Close() error { … }
func TestServerCloseListenerOnce(t *testing.T) { … }
func TestServerShutdownThenServe(t *testing.T) { … }
func TestStripPortFromHost(t *testing.T) { … }
func TestServerContexts(t *testing.T) { … }
func testServerContexts(t *testing.T, mode testMode) { … }
func TestConnContextNotModifyingAllContexts(t *testing.T) { … }
func testConnContextNotModifyingAllContexts(t *testing.T, mode testMode) { … }
func TestUnsupportedTransferEncodingsReturn501(t *testing.T) { … }
func testUnsupportedTransferEncodingsReturn501(t *testing.T, mode testMode) { … }
func TestContentEncodingNoSniffing(t *testing.T) { … }
func testContentEncodingNoSniffing(t *testing.T, mode testMode) { … }
func TestTimeoutHandlerSuperfluousLogs(t *testing.T) { … }
func testTimeoutHandlerSuperfluousLogs(t *testing.T, mode testMode) { … }
func fetchWireResponse(host string, http1ReqBody []byte) ([]byte, error) { … }
func BenchmarkResponseStatusLine(b *testing.B) { … }
func TestDisableKeepAliveUpgrade(t *testing.T) { … }
func testDisableKeepAliveUpgrade(t *testing.T, mode testMode) { … }
type tlogWriter …
func (w tlogWriter) Write(p []byte) (int, error) { … }
func TestWriteHeaderSwitchingProtocols(t *testing.T) { … }
func testWriteHeaderSwitchingProtocols(t *testing.T, mode testMode) { … }
func TestMuxRedirectRelative(t *testing.T) { … }
func TestQuerySemicolon(t *testing.T) { … }
func testQuerySemicolon(t *testing.T, mode testMode, query string, wantX string, allowSemicolons, expectParseFormErr bool) { … }
func TestMaxBytesHandler(t *testing.T) { … }
func testMaxBytesHandler(t *testing.T, mode testMode, maxSize, requestSize int64) { … }
func TestEarlyHints(t *testing.T) { … }
func TestProcessing(t *testing.T) { … }
func TestParseFormCleanup(t *testing.T) { … }
func testParseFormCleanup(t *testing.T, mode testMode) { … }
func TestHeadBody(t *testing.T) { … }
func TestGetBody(t *testing.T) { … }
func testHeadBody(t *testing.T, mode testMode, chunked bool, method string) { … }
func TestDisableContentLength(t *testing.T) { … }
func testDisableContentLength(t *testing.T, mode testMode) { … }
func TestErrorContentLength(t *testing.T) { … }
func testErrorContentLength(t *testing.T, mode testMode) { … }
func TestError(t *testing.T) { … }
func TestServerReadAfterWriteHeader100Continue(t *testing.T) { … }
func testServerReadAfterWriteHeader100Continue(t *testing.T, mode testMode) { … }
func TestServerReadAfterHandlerDone100Continue(t *testing.T) { … }
func testServerReadAfterHandlerDone100Continue(t *testing.T, mode testMode) { … }
func TestServerReadAfterHandlerAbort100Continue(t *testing.T) { … }
func testServerReadAfterHandlerAbort100Continue(t *testing.T, mode testMode) { … }