Better example for setting header fields in documentation
|Reported by:||bbjay||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||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 2 years ago by aaugustin
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted