[Django] #20459: Better example for setting header fields in documentation

6 views
Skip to first unread message

Django

unread,
May 19, 2013, 6:58:27 AM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+--------------------
Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
I think the current example for setting header fields in HttpResponse
objects is a bit unfortunate:
https://docs.djangoproject.com/en/dev/ref/request-response/#setting-
header-fields

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.
https://github.com/bbjay/django/commit/227f4bf4fe7971754ecc09aeb141b824a3f0550b

--
Ticket URL: <https://code.djangoproject.com/ticket/20459>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
May 19, 2013, 7:36:23 AM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+------------------------------------

Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:1>

Django

unread,
May 19, 2013, 8:55:02 AM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+------------------------------------

Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by tadeck):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:2>

Django

unread,
May 19, 2013, 9:26:19 AM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+------------------------------------

Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (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?

--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:3>

Django

unread,
May 19, 2013, 10:41:24 AM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+------------------------------------

Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by bbjay):

* cc: bbjay (added)
* has_patch: 0 => 1


Comment:

https://github.com/django/django/pull/1174

--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:4>

Django

unread,
May 19, 2013, 12:31:22 PM5/19/13
to django-...@googlegroups.com
#20459: Better example for setting header fields in documentation
--------------------------------------+------------------------------------
Reporter: bbjay | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Documentation | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"e83ff42792eb52235cacda58f3441673cc4e4c94"]:
{{{
#!CommitTicketReference repository=""
revision="e83ff42792eb52235cacda58f3441673cc4e4c94"
Fixed #20459 - Improved example for setting HTTP header fields.

Thanks Jérémie Blaser.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/20459#comment:5>

Reply all
Reply to author
Forward
0 new messages