Opened 17 years ago

Closed 16 years ago

#7228 closed (fixed)

ETag value does not meet HTTP spec

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

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 16 years ago.
Patch implementing skjohn's suggestion

Download all attachments as: .zip

Change History (3)

by Simon Greenhill, 16 years ago

Attachment: 7228.diff added

Patch implementing skjohn's suggestion

comment:1 by Simon Greenhill, 16 years ago

Has patch: set
Triage Stage: UnreviewedReady for checkin
Version: 0.96SVN

comment:2 by Adrian Holovaty, 16 years ago

Resolution: fixed
Status: newclosed

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

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