mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 18:51:18 -08:00
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 <[email protected]>