mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #27083 -- Added support for weak ETags.
This commit is contained in:
parent
e7abb5ba86
commit
4ef0e019b7
11 changed files with 130 additions and 68 deletions
|
@ -491,6 +491,9 @@ Miscellaneous
|
|||
* The admin's widget for ``IntegerField`` uses ``type="number"`` rather than
|
||||
``type="text"``.
|
||||
|
||||
* ETags are now parsed according to the :rfc:`7232` Conditional Requests
|
||||
specification rather than the syntax from :rfc:`2616`.
|
||||
|
||||
.. _deprecated-features-1.11:
|
||||
|
||||
Features deprecated in 1.11
|
||||
|
|
|
@ -66,6 +66,14 @@ last time the resource was modified, or ``None`` if the resource doesn't
|
|||
exist. The function passed to the ``etag`` decorator should return a string
|
||||
representing the `ETag`_ for the resource, or ``None`` if it doesn't exist.
|
||||
|
||||
.. versionchanged:: 1.11
|
||||
|
||||
In older versions, the return value from ``etag_func()`` was interpreted as
|
||||
the unquoted part of the ETag. That prevented the use of weak ETags, which
|
||||
have the format ``W/"<string>"``. The return value is now expected to be
|
||||
an ETag as defined by the specification (including the quotes), although
|
||||
the unquoted format is also accepted for backwards compatibility.
|
||||
|
||||
Using this feature usefully is probably best explained with an example.
|
||||
Suppose you have this pair of models, representing a simple blog system::
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue