Opened 17 years ago

Closed 17 years ago

#5754 closed (fixed)

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

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

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 by Malcolm Tredinnick, 17 years ago

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 by hauser <hauserx@…>, 17 years ago

Resolution: invalid
Status: closedreopened

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

comment:3 by Malcolm Tredinnick, 17 years ago

Triage Stage: UnreviewedAccepted

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

comment:4 by Ramiro Morales, 17 years ago

See also #5772 that includes a patch.

comment:5 by Malcolm Tredinnick, 17 years ago

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