mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
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.
This commit is contained in:
parent
67df6fedae
commit
5b2f600036
4 changed files with 31 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue