fix: use content-encoding: deflate when returning compressed content

the RFCs don't mandate it but it seems like chrome and firefox only
understand that.
This commit is contained in:
Simon Cruanes 2020-03-25 23:03:57 -04:00
parent 64df8616f9
commit 4023a5ab79

View file

@ -152,7 +152,7 @@ let cb_encode_compressed_stream
headers= headers=
(resp.headers (resp.headers
|> S.Headers.remove "Content-Length" |> S.Headers.remove "Content-Length"
|> S.Headers.set "Transfer-Encoding" "deflate, chunked"); |> S.Headers.set "Content-Encoding" "deflate");
body=`Stream (encode_deflate_stream_ ~buf_size str); body=`Stream (encode_deflate_stream_ ~buf_size str);
} }
) else None ) else None