Opened 4 years ago

Last modified 4 years ago

#31789 closed Cleanup/optimization

Add a cleaner interface for response headers — at Version 5

Reported by: Tom Carrick Owned by: Tom Carrick
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 (last modified by Tom Carrick)

This proposal is to replace HttpResponse._headers with HttpResponse.headers as a public interface using a variation of django.utils.datasctructures.CaseInsensitiveMapping.

It also includes updating tests and documentation to use this, rather than the old dict-like interface, i.e. response.headers['Content-Type'] = 'application/json' response['Content-Type'] = 'application/json'.

The dict-like interface won't be deprecated, but will become undocumented, and tests added purely for backwards-compatibility.

Mailing list
PR

Change History (5)

comment:1 by Tom Carrick, 4 years ago

Owner: changed from nobody to Tom Carrick
Status: newassigned

comment:2 by Tom Carrick, 4 years ago

Needs documentation: set
Needs tests: set

comment:3 by Tom Carrick, 4 years ago

Needs documentation: unset
Needs tests: unset
Version: 3.0master

comment:4 by Asif Saifuddin Auvi, 4 years ago

Triage Stage: UnreviewedAccepted

I believe this should be accepted

comment:5 by Tom Carrick, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top