Fixed #34194 -- Added django.utils.http.content_disposition_header().

This commit is contained in:
Alex Vandiver 2022-11-30 15:09:49 -05:00 committed by Mariusz Felisiak
parent 3d3e955efa
commit cbce427c17
5 changed files with 66 additions and 16 deletions

View file

@ -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.