Opened 4 years ago

Closed 4 years ago

#32002 closed New feature (fixed)

Allow headers to be passed into HttpResponse()

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

Mailing list discussion

e.g. HttpResponse('content', headers={'X-Foo': 'aaa'})

I think it also makes sense to add this to django.shortcuts.render.

Change History (11)

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

Type: UncategorizedNew feature

comment:3 by Carlton Gibson, 4 years ago

Triage Stage: UnreviewedAccepted

Yes, as per discussion, certainly for the main feature.

I think it also makes sense to add this to django.shortcuts.render.

I'm initially sceptical about this. I think we should be cautious about adding extra parameters to shortcuts.
My inclination would be towards saying, "Either adjust the response once you have it, or don't use render" if folks need more than it currently offers. (Note: "...initially sceptical...".)

comment:4 by Tom Carrick, 4 years ago

Has patch: set

comment:5 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:6 by Tom Carrick, 4 years ago

Patch needs improvement: unset

comment:7 by Mariusz Felisiak, 4 years ago

Needs documentation: set

comment:8 by Tom Carrick, 4 years ago

Needs documentation: unset

comment:9 by Mariusz Felisiak, 4 years ago

Triage Stage: AcceptedReady for checkin

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

In 2e7cc954:

Refs #32002 -- Added tests for HttpResponse's content_type parameter.

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In dcb6904:

Fixed #32002 -- Added headers parameter to HttpResponse and subclasses.

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