Opened 9 years ago

Closed 9 years ago

#11704 closed (duplicate)

GZIP middleware consumes the HTTPResponse iterator, even if Content-Encoding is set to identity

Reported by: teh Owned by: nobody
Component: Core (Other) Version: 1.1
Severity: Keywords: gzip, middleware
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


There's a check like

22 	        if response.has_header('Content-Encoding'):
23 	            return response

in the gzip middleware, but it gets executed _after_ the following check

        if response.status_code != 200 or len(response.content) < 200:
 	            return response

The "response.content" consumes an iterator passed to HttpResponse, which breaks e.g. in case of generators.

Change History (1)

comment:1 Changed 9 years ago by Alex Gaynor

Resolution: duplicate
Status: newclosed

Dupe of #6527, please search the archives before filing a new ticket.

Note: See TracTickets for help on using tickets.
Back to Top