Code

Opened 6 years ago

Closed 6 years ago

#7228 closed (fixed)

ETag value does not meet HTTP spec

Reported by: skjohn@… Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The HTTP spec says that ETag values should be quoted either as "etag" or W/"etag". The current implementation (in modules django.middleware.common and django.utils.cache) do not quote these.

The code would therefore change as follows:

etag = md5.new(response.content).hexdigest()

etag = '"%s"' % md5.new(response.content).hexdigest()

Attachments (1)

7228.diff (1.3 KB) - added by Simon Greenhill 6 years ago.
Patch implementing skjohn's suggestion

Download all attachments as: .zip

Change History (3)

Changed 6 years ago by Simon Greenhill

Patch implementing skjohn's suggestion

comment:1 Changed 6 years ago by Simon Greenhill

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Ready for checkin
  • Version changed from 0.96 to SVN

comment:2 Changed 6 years ago by adrian

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

(In [7659]) Fixed #7228 -- Fixed our ETag header creation to meet the HTTP spec, by quoting it. Thanks, skjohn@…

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.