diff options
author | Loïc Hoguin <[email protected]> | 2024-01-05 15:53:42 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2024-01-05 15:53:42 +0100 |
commit | 5b2f600036145653c48a7e8a60853e4a0ecc770b (patch) | |
tree | 01ed5b3a36faa666026802356807a53b2805fdca /src | |
parent | 67df6fedaea83b8159fbadbadf460a1f3dd98c51 (diff) | |
download | cowboy-5b2f600036145653c48a7e8a60853e4a0ecc770b.tar.gz cowboy-5b2f600036145653c48a7e8a60853e4a0ecc770b.tar.bz2 cowboy-5b2f600036145653c48a7e8a60853e4a0ecc770b.zip |
Don't automatically compress when response has etag
In the cowboy_compress_h stream handler.
Otherwise this could cause issues with caching, with the
etag being the same for compressed/uncompressed content.
Users that wish to send etags AND compress will have to
do it manually for the time being.
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_compress_h.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cowboy_compress_h.erl b/src/cowboy_compress_h.erl index 374cb6a..bb4a265 100644 --- a/src/cowboy_compress_h.erl +++ b/src/cowboy_compress_h.erl @@ -96,6 +96,9 @@ check_req(Req) -> %% Do not compress responses that contain the content-encoding header. check_resp_headers(#{<<"content-encoding">> := _}, State) -> State#state{compress=undefined}; +%% Do not compress responses that contain the etag header. +check_resp_headers(#{<<"etag">> := _}, State) -> + State#state{compress=undefined}; check_resp_headers(_, State) -> State. |