Opened 9 years ago

Closed 9 years ago

#5754 closed (fixed)

HttpResponse uses 'content-type' while GZipMiddleware expects 'Content-Type'

Reported by: hauser <hauserx@…> Owned by: nobody
Component: Uncategorized Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Because GZipMiddleware expect different case that HttpResponse sets it does compress javascript - in the comment in GZipMiddleware it says it should not.

Change History (5)

comment:1 Changed 9 years ago by Malcolm Tredinnick

Resolution: invalid
Status: newclosed

All access to headers in HttpResponse is done through the __getitem__ and has_header() methods on that class, so the case won't matter. I think you're diagnosing the wrong issue here.

Please reopen if you have more explanation about the real issue you are seeing, but I just tested HttpResponse and both 'content-type' and 'Content-Type' returned the same data, as expected.

comment:2 Changed 9 years ago by hauser <hauserx@…>

Resolution: invalid
Status: closedreopened

GZipMiddleware uses response.get method, not response[] construction. And HttpResponse.get method is case sensitive.

comment:3 Changed 9 years ago by Malcolm Tredinnick

Triage Stage: UnreviewedAccepted

Good point -- I'd missed the typo in the get() method. It's a bug.

comment:4 Changed 9 years ago by Ramiro Morales

See also #5772 that includes a patch.

comment:5 Changed 9 years ago by Malcolm Tredinnick

Resolution: fixed
Status: reopenedclosed

(In [6537]) Changed HttpResponse.get() to lower case the header value before looking it up. This makes it consistent will other header accesses. Fixed #5754, #5772.

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