summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
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
~~~~~~~~~~