From cbce427c17b66faec7ced0639346dc6905a498f9 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Wed, 30 Nov 2022 15:09:49 -0500 Subject: Fixed #34194 -- Added django.utils.http.content_disposition_header(). --- docs/ref/utils.txt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/ref') 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. -- cgit v1.3