Opened 3 years ago
Closed 3 years ago
#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)
Change History (7)
by , 3 years ago
| Attachment: | 0001-Extract-function-for-generating-a-proper-Content-Dis.patch added | 
|---|
comment:1 by , 3 years ago
| Needs documentation: | set | 
|---|---|
| Triage Stage: | Unreviewed → Accepted | 
OK, I guess this seems reasonable yes. 
Please open a PR. A docs entry and release note would be needed. 
comment:3 by , 3 years ago
| Needs documentation: | unset | 
|---|
comment:4 by , 3 years ago
| Owner: | changed from to | 
|---|---|
| Status: | new → assigned | 
comment:5 by , 3 years ago
| Triage Stage: | Accepted → Ready for checkin | 
|---|
  Note:
 See   TracTickets
 for help on using tickets.
    
Implementation, with tests