Opened 6 years ago

Closed 6 years ago

#20459 closed Cleanup/optimization (fixed)

Better example for setting header fields in documentation

Reported by: bbjay Owned by: nobody
Component: Documentation Version: master
Severity: Normal Keywords:
Cc: bbjay Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


I think the current example for setting header fields in HttpResponse objects is a bit unfortunate:

The Cache-Control field (also the Vary field) is a comma-separated multi value field.
e.g. Cache-Control: public, max-age=60
Setting its value by a dictionary access can unintentionally remove other present values, e.g. set by another middleware.

My proposed solution: change example to use 'Age' header field, mention and encourage use of patch_vary_header and patch_cache_control methods.

Change History (5)

comment:1 Changed 6 years ago by Aymeric Augustin

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by tadeck

That fix looks nice. Would you care to create pull request etc., or should someone else do that?

comment:3 Changed 6 years ago by bbjay

Cool. Yes, i will gladly do that, just wanted to hear another opinion before filling a PR.
btw: do i need to set myself to cc to get updates for this ticket by email?

comment:4 Changed 6 years ago by bbjay

Cc: bbjay added
Has patch: set

comment:5 Changed 6 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In e83ff42792eb52235cacda58f3441673cc4e4c94:

Fixed #20459 - Improved example for setting HTTP header fields.

Thanks Jérémie Blaser.

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