[Django] #34194: Extract function for generating proper Content-Disposition headers

32 views
Skip to first unread message

Django

unread,
Nov 30, 2022, 3:14:40 PM11/30/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-----------------------------------------+------------------------
Reporter: Alex Vandiver | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
Applications may need to generate Content-Disposition headers, and it
seems a waste to duplicate the logic that already exists in FileResponse.
Uses for this include things like `django-sendfile2`
(https://github.com/moggers87/django-
sendfile2/blob/a13039aabbba05e50631804118a4d99db4f99ad4/django_sendfile/utils.py#L108-L118)
and similar.

--
Ticket URL: <https://code.djangoproject.com/ticket/34194>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 30, 2022, 3:15:14 PM11/30/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------+--------------------------------------

Reporter: Alex Vandiver | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Alex Vandiver):

* Attachment "0001-Extract-function-for-generating-a-proper-Content-
Dis.patch" added.

Implementation, with tests

Django

unread,
Dec 1, 2022, 3:54:54 AM12/1/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------+------------------------------------
Reporter: Alex Vandiver | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Carlton Gibson):

* needs_docs: 0 => 1
* stage: Unreviewed => Accepted


Comment:

OK, I guess this seems reasonable yes.

Please open a PR. A [https://docs.djangoproject.com/en/4.1/ref/utils/#s
-django-utils-http docs entry] and release note would be needed.

--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:1>

Django

unread,
Dec 1, 2022, 12:49:52 PM12/1/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------+------------------------------------
Reporter: Alex Vandiver | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Alex Vandiver):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/16349 PR] sent.

--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:2>

Django

unread,
Dec 1, 2022, 12:54:03 PM12/1/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------+------------------------------------
Reporter: Alex Vandiver | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Alex Vandiver):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:3>

Django

unread,
Dec 2, 2022, 1:58:28 AM12/2/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------+-----------------------------------------
Reporter: Alex Vandiver | Owner: Alex Vandiver
Type: New feature | Status: assigned

Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Mariusz Felisiak):

* owner: nobody => Alex Vandiver
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:4>

Django

unread,
Dec 5, 2022, 7:10:15 AM12/5/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------------+-------------------------------------

Reporter: Alex Vandiver | Owner: Alex
| Vandiver
Type: New feature | Status: assigned
Component: HTTP handling | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:5>

Django

unread,
Dec 5, 2022, 11:49:50 PM12/5/22
to django-...@googlegroups.com
#34194: Extract function for generating proper Content-Disposition headers
-------------------------------------+-------------------------------------
Reporter: Alex Vandiver | Owner: Alex
| Vandiver
Type: New feature | Status: closed

Component: HTTP handling | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"cbce427c17b66faec7ced0639346dc6905a498f9" cbce427]:
{{{
#!CommitTicketReference repository=""
revision="cbce427c17b66faec7ced0639346dc6905a498f9"
Fixed #34194 -- Added django.utils.http.content_disposition_header().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/34194#comment:6>

Reply all
Reply to author
Forward
0 new messages