Issue #577 resolved

GzipFilter doesn't force an update of the Content-Length header

Anonymous created an issue

When the GzipFilter is used, the body is changed and the length is affected. The _cphttptools.py doesn't update the header "Content-Length" of the response if the content is not a stream and if the header already exists.

A workaround is for the GzipFilter to remove the Content-Length header from the response before returning. This forces the Response.finalize to recalculate the proper content length from the compressed body and update the header.

Reported by sylvain@plutinosoft.com

Comments (4)

  1. Log in to comment