diff options
| author | Adnan Umer <u.adnan@outlook.com> | 2019-08-14 01:40:09 +0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-08-16 15:25:42 +0200 |
| commit | 6805c0f99f4790f28a97d597934d0877ba81dba9 (patch) | |
| tree | 8e5eeb7d00e197e41943b48f6bacec51100b7539 /docs | |
| parent | 7da6a28a447dc0db2a2c6ef31894094eb968f408 (diff) | |
Fixed #30701 -- Updated patch_vary_headers() to handle an asterisk according to RFC 7231.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/utils.txt | 10 | ||||
| -rw-r--r-- | docs/releases/3.0.txt | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 3d3dbab2fe..06136da08f 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -73,8 +73,14 @@ need to distinguish caches by the ``Accept-language`` header. .. function:: patch_vary_headers(response, newheaders) Adds (or updates) the ``Vary`` header in the given ``HttpResponse`` object. - ``newheaders`` is a list of header names that should be in ``Vary``. - Existing headers in ``Vary`` aren't removed. + ``newheaders`` is a list of header names that should be in ``Vary``. If + headers contains an asterisk, then ``Vary`` header will consist of a single + asterisk ``'*'``. Otherwise, existing headers in ``Vary`` aren't removed. + + .. versionchanged:: 3.0 + + Handling an asterisk ``'*'`` according to :rfc:`7231#section-7.1.4` was + added. .. function:: get_cache_key(request, key_prefix=None) diff --git a/docs/releases/3.0.txt b/docs/releases/3.0.txt index 42f4c72495..bc9cbe3751 100644 --- a/docs/releases/3.0.txt +++ b/docs/releases/3.0.txt @@ -514,6 +514,11 @@ Miscellaneous :class:`~django.db.models.OneToOneField` ``'_id'`` attribute now unsets the corresponding field. Accessing the field afterwards will result in a query. +* :func:`~django.utils.cache.patch_vary_headers` now handles an asterisk + ``'*'`` according to :rfc:`7231#section-7.1.4`, i.e. if a list of header + field names contains an asterisk, then the ``Vary`` header will consist of a + single asterisk ``'*'``. + .. _deprecated-features-3.0: Features deprecated in 3.0 |
