]> Cypherpunks repositories - gostls13.git/commit
net/http: add ErrAbortHandler, make Server quiet if used as panic value
authorBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Nov 2016 22:49:16 +0000 (22:49 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 10 Nov 2016 23:09:19 +0000 (23:09 +0000)
commit9997545a8626bf1a73002f44a7b7538988da4e76
tree1cf62adaaf45da87830a6366bccfb3047b76ec6b
parent1c54119315d9f3bd9212c01db2fd4653314959e0
net/http: add ErrAbortHandler, make Server quiet if used as panic value

Add an explicit way for Handlers to abort their response to the client
and also not spam their error log with stack traces.

panic(nil) also worked in the past (for http1 at least), so continue
to make that work (and test it). But ErrAbortHandler is more explicit.

Updates #17790 (needs http2 updates also)

Change-Id: Ib1456905b27e2ae8cf04c0983dc73e314a4a751e
Reviewed-on: https://go-review.googlesource.com/33099
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/net/http/clientserver_test.go
src/net/http/server.go