Commit 792f9c9a authored by Brad Fitzpatrick's avatar Brad Fitzpatrick Committed by Tom Bergan

net/http: clarify Handler panic behavior across HTTP versions

Updates #18997

Change-Id: Ib1961a4c26b42f99b98b255beb7e2a74b632e0c1
Reviewed-on: https://go-review.googlesource.com/48551Reviewed-by: default avatarJoe Shaw <joe@joeshaw.org>
Reviewed-by: default avatarTom Bergan <tombergan@google.com>
parent d5da1042
...@@ -75,9 +75,10 @@ var ( ...@@ -75,9 +75,10 @@ var (
// If ServeHTTP panics, the server (the caller of ServeHTTP) assumes // If ServeHTTP panics, the server (the caller of ServeHTTP) assumes
// that the effect of the panic was isolated to the active request. // that the effect of the panic was isolated to the active request.
// It recovers the panic, logs a stack trace to the server error log, // It recovers the panic, logs a stack trace to the server error log,
// and hangs up the connection. To abort a handler so the client sees // and either closes the network connection or sends an HTTP/2
// an interrupted response but the server doesn't log an error, panic // RST_STREAM, depending on the HTTP protocol. To abort a handler so
// with the value ErrAbortHandler. // the client sees an interrupted response but the server doesn't log
// an error, panic with the value ErrAbortHandler.
type Handler interface { type Handler interface {
ServeHTTP(ResponseWriter, *Request) ServeHTTP(ResponseWriter, *Request)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment