tailscale/tsweb
James Tucker 08a34edd91
tsweb: add transparent compression for StdHandler
Implements inline compression for both gzip and brotli via the brotli
library. The library requires that Content-Type is set. The
implementation here explicitly avoids wrapping the ResponseWriter in
cases where Accept-Encoding is not set so as to maximally attempt to get
out of the way of hijack and upgrade concerns. It also avoids any
attempt at compression if Content-Encoding is already set so that
handlers that already perform compression are unaffected.

Signed-off-by: James Tucker <james@tailscale.com>
2022-11-30 13:49:04 -08:00
..
compress.go tsweb: add transparent compression for StdHandler 2022-11-30 13:49:04 -08:00
compress_test.go tsweb: add transparent compression for StdHandler 2022-11-30 13:49:04 -08:00
debug.go all: use any instead of interface{} 2022-03-17 11:35:09 -07:00
debug_test.go all: use any instead of interface{} 2022-03-17 11:35:09 -07:00
log.go tsweb: mark AccessLogRecord fields as omitempty (#5250) 2022-08-01 21:17:38 -07:00
tsweb.go tsweb: add transparent compression for StdHandler 2022-11-30 13:49:04 -08:00
tsweb_test.go tsweb: export version metrics to Prometheus 2022-11-22 15:50:10 +00:00