Skip to content

Commit

Permalink
Fix Content-Length header when compressing gzip (#1053)
Browse files Browse the repository at this point in the history
See also #954
  • Loading branch information
keul authored Dec 14, 2024
1 parent c8d17d7 commit 392e02a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pycsw/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ def compress_response(response, compression_level):
gzipfile.write(response)
gzipfile.close()
compressed_response = buf.getvalue()
compression_headers = {'Content-Encoding': 'gzip'}
compression_headers = {
'Content-Encoding': 'gzip',
'Content-Length': str(len(compressed_response)),
}
return compressed_response, compression_headers


Expand Down

0 comments on commit 392e02a

Please sign in to comment.