Django

Code

Ticket #7228 (closed: fixed)

Opened 2 months ago

Last modified 1 month ago

ETag value does not meet HTTP spec

Reported by: skjohn@us.ibm.com Assigned to: nobody
Milestone: Component: HTTP handling
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

7228.diff (1.3 kB) - added by Simon Greenhill on 06/14/08 07:10:27.
Patch implementing skjohn's suggestion

Change History

06/14/08 07:10:27 changed by Simon Greenhill

  • attachment 7228.diff added.

Patch implementing skjohn's suggestion

06/14/08 07:10:48 changed by Simon Greenhill

  • needs_better_patch changed.
  • needs_tests changed.
  • version changed from 0.96 to SVN.
  • needs_docs changed.
  • has_patch set to 1.
  • stage changed from Unreviewed to Ready for checkin.

06/15/08 23:13:05 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #7228 (ETag value does not meet HTTP spec)




Change Properties
Action