Opened 15 years ago

Closed 15 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: no UI/UX: no

Description

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 by Alex Gaynor, 15 years ago

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