#34194 closed New feature (fixed)

Extract function for generating proper Content-Disposition headers

Reported by: Alex Vandiver Owned by: Alex Vandiver
Component: HTTP handling Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Attachments (1)

0001-Extract-function-for-generating-a-proper-Content-Dis.patch (4.9 KB ) - added by Alex Vandiver 17 months ago.
Implementation, with tests

Download all attachments as: .zip

Change History (7)

by Alex Vandiver, 17 months ago

Implementation, with tests

comment:1 by Carlton Gibson, 17 months ago

Needs documentation: set
Triage Stage: UnreviewedAccepted

OK, I guess this seems reasonable yes.

Please open a PR. A docs entry and release note would be needed.

comment:2 by Alex Vandiver, 17 months ago

Has patch: set

PR sent.

comment:3 by Alex Vandiver, 17 months ago

Needs documentation: unset

comment:4 by Mariusz Felisiak, 17 months ago

Owner: changed from nobody to Alex Vandiver
Status: newassigned

comment:5 by Mariusz Felisiak, 17 months ago

Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 17 months ago

Resolution: fixed
Status: assignedclosed

In cbce427:

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

Note: See TracTickets for help on using tickets.
Back to Top