aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/http/server.go')
-rw-r--r--src/net/http/server.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net/http/server.go b/src/net/http/server.go
index 902d6d3367..5502ce7ac4 100644
--- a/src/net/http/server.go
+++ b/src/net/http/server.go
@@ -41,7 +41,7 @@ var (
// ErrBodyNotAllowed is returned by ResponseWriter.Write calls
// when the HTTP method or response code does not permit a
// body.
- ErrBodyNotAllowed = errors.New("http: request method or response status code does not allow body")
+ ErrBodyNotAllowed = internal.ErrBodyNotAllowed
// ErrHijacked is returned by ResponseWriter.Write calls when
// the underlying connection has been hijacked using the
@@ -1871,7 +1871,7 @@ func (e statusError) Error() string { return StatusText(e.code) + ": " + e.text
// While any panic from ServeHTTP aborts the response to the client,
// panicking with ErrAbortHandler also suppresses logging of a stack
// trace to the server's error log.
-var ErrAbortHandler = errors.New("net/http: abort Handler")
+var ErrAbortHandler = internal.ErrAbortHandler
// isCommonNetReadError reports whether err is a common error
// encountered during reading a request off the network when the
@@ -3096,6 +3096,7 @@ type Server struct {
listeners map[*net.Listener]struct{}
activeConn map[*conn]struct{}
onShutdown []func()
+ h2 *http2Server
listenerGroup sync.WaitGroup
}
@@ -3396,7 +3397,7 @@ func (s *Server) shouldConfigureHTTP2ForServe() bool {
// passed this tls.Config to tls.NewListener. And if they did,
// it's too late anyway to fix it. It would only be potentially racy.
// See Issue 15908.
- return slices.Contains(s.TLSConfig.NextProtos, http2NextProtoTLS)
+ return slices.Contains(s.TLSConfig.NextProtos, "h2")
}
// ErrServerClosed is returned by the [Server.Serve], [ServeTLS], [ListenAndServe],
@@ -3867,8 +3868,7 @@ func (s *Server) onceSetNextProtoDefaults() {
// to add it.
return
}
- conf := &http2Server{}
- s.nextProtoErr = http2ConfigureServer(s, conf)
+ s.configureHTTP2()
}
// TimeoutHandler returns a [Handler] that runs h with the given time limit.