Code

Opened 7 years ago

Closed 7 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.

Attachments (0)

Change History (5)

comment:1 Changed 7 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

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

  • Resolution invalid deleted
  • Status changed from closed to reopened

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

comment:3 Changed 7 years ago by mtredinnick

  • Triage Stage changed from Unreviewed to Accepted

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

comment:4 Changed 7 years ago by ramiro

See also #5772 that includes a patch.

comment:5 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from reopened to closed

(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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.