summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAlex Vandiver <alex@chmrr.net>2022-11-30 15:09:49 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-12-05 13:08:00 +0100
commitcbce427c17b66faec7ced0639346dc6905a498f9 (patch)
tree894b0990050dcf94c36010838717dd96351fbcc5 /docs
parent3d3e955efaaeb4cc968e522592c5c1e47bdc72c4 (diff)
Fixed #34194 -- Added django.utils.http.content_disposition_header().
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/utils.txt9
-rw-r--r--docs/releases/4.2.txt3
2 files changed, 12 insertions, 0 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 1c9141a986..b1a08dc0e1 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -729,6 +729,15 @@ escaping HTML.
Outputs a string in the format ``Wdy, DD Mon YYYY HH:MM:SS GMT``.
+.. function:: content_disposition_header(as_attachment, filename)
+
+ .. versionadded:: 4.2
+
+ Constructs a ``Content-Disposition`` HTTP header value from the given
+ ``filename`` as specified by :rfc:`6266`. Returns ``None`` if
+ ``as_attachment`` is ``False`` and ``filename`` is ``None``, otherwise
+ returns a string suitable for the ``Content-Disposition`` HTTP header.
+
.. function:: base36_to_int(s)
Converts a base 36 string to an integer.
diff --git a/docs/releases/4.2.txt b/docs/releases/4.2.txt
index 054f8d6621..7e2aa6e5d6 100644
--- a/docs/releases/4.2.txt
+++ b/docs/releases/4.2.txt
@@ -321,6 +321,9 @@ Utilities
documented functions for handling URL redirects. The Django functions were
not affected.
+* The new :func:`django.utils.http.content_disposition_header` function returns
+ a ``Content-Disposition`` HTTP header value as specified by :rfc:`6266`.
+
Validators
~~~~~~~~~~