tailscale/tsweb
Paul Scott d97cddd876 tsweb: swallow panics
With this change, the error handling and request logging are all done in defers
after calling inner.ServeHTTP. This ensures that any recovered values which we
want to re-panic with retain a useful stacktrace.  However, we now only
re-panic from errorHandler when there's no outside logHandler. Which if you're
using StdHandler there always is. We prefer this to ensure that we are able to
write a 500 Internal Server Error to the client. If a panic hits http.Server
then the response is not sent back.

Updates #12784

Signed-off-by: Paul Scott <paul@tailscale.com>
2024-07-18 15:41:04 +01:00
..
promvarz derp/xdp,cmd/xdpderper: initial skeleton (#12390) 2024-06-14 08:45:24 -07:00
varz tsweb/varz: add charset=utf-8 to varz handler 2024-03-27 19:56:22 -07:00
debug.go Revert "tsweb: update ServeMux matching to 1.22.0 syntax (#11090)" (#11125) 2024-02-13 10:49:36 -08:00
debug_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
log.go tsweb: rename AccessLogRecord's When to Time 2024-05-31 12:33:35 -04:00
request_id.go tsweb: switch to fastuuid for request ID generation 2024-04-09 14:05:20 -07:00
tsweb.go tsweb: swallow panics 2024-07-18 15:41:04 +01:00
tsweb_test.go tsweb: swallow panics 2024-07-18 15:41:04 +01:00