[Django] #30701: Django generates overly verbose and possibly invalid Vary headers

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #30701: Django generates overly verbose and possibly invalid Vary headers

Django
#30701: Django generates overly verbose and possibly invalid Vary headers
-----------------------------------------+------------------------
               Reporter:  Alexander-TX   |          Owner:  nobody
                   Type:  Bug            |         Status:  new
              Component:  HTTP handling  |        Version:  2.2
               Severity:  Normal         |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  1
                  UI/UX:  0              |
-----------------------------------------+------------------------
 Function "patch_vary_headers", simply appends new headers to list. If view
 code sets Vary header to asterisk, the resulting header (after applying
 SessionMiddleware and LocaleMiddleware) looks like this:

 {{{
 Vary: *, Accept-Language, Cookie
 }}}

 This is unnecessary and possible violates HTTP spec:

 {{{
 The "Vary" header field in a response describes what parts of a
    request message, aside from the method, Host header field, and
    request target, might influence the origin server's process for
    selecting and representing this response.  The value consists of
    either a single asterisk ("*") or a list of header field names
    (case-insensitive).

      Vary = "*" / 1#field-name
 }}}

 (from https://tools.ietf.org/html/rfc7231#page-70)

 I am using Django to implement REST API, so I'd like it to speak robust
 HTTP, that works with all present and future caching libraries, — even if
 widely used browsers and Nginx can correctly interpret current form of the
 header.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/055.cd2d4ae21aacb4c26c55e035bb7c2585%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value. (was: Django generates overly verbose and possibly invalid Vary headers)

Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Core (Cache system)  |                  Version:  2.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by Carlton Gibson):

 * type:  Bug => New feature
 * stage:  Unreviewed => Accepted
 * component:  HTTP handling => Core (Cache system)


Comment:

 Hi Alexander. Thanks for the report.

 Happy to accept this as an enhancement. (It's clear from the existing test
 cases that `'*'` was never considered.)

 I was going to uncheck "Easy Pickings" but perhaps it is simple enough...

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.3896dc79bf5a6db5e7e9d6d907c4c8b3%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
                                     |  Umer
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  2.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Adnan Umer):

 * owner:  nobody => Adnan Umer
 * status:  new => assigned


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.699641ac383ba6485b2bf11065ecbc17%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
                                     |  Umer
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  2.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Adnan Umer):

 [https://github.com/django/django/pull/11666 PR]

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.0b3a1954627e41bd776600eb8bd8fada%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
                                     |  Umer
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  1
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * needs_docs:  0 => 1
 * version:  2.2 => master


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.73b7daa1d824130d89fb1562a8ed23a0%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
                                     |  Umer
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Adnan Umer):

 * needs_docs:  1 => 0


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.8d6dcd6b881564d49e0a3c8392b6b205%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Ngalim
                                     |  Siregar
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Ngalim Siregar):

 * owner:  Adnan Umer => Ngalim Siregar


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.31bad7e593f9e7bb1576a75a4b1e2c23%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
                                     |  Umer
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Ngalim Siregar):

 * owner:  Ngalim Siregar => Adnan Umer


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.0b9a6f8f22947966dd7264db17d4cf4e%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
         Type:                       |  Umer
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * has_patch:  0 => 1
 * type:  New feature => Cleanup/optimization


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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.2d8509bb25df232d2e62f3d554c5620c%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
         Type:                       |  Umer
  Cleanup/optimization               |                   Status:  assigned
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

 * stage:  Accepted => Ready for checkin


Comment:

 PR Looks good.

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.9441e0b93d92ff72243722ea440ed30b%40djangoproject.com.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #30701: Allowing patch_vary_headers() caching utility to handle '*' value.

Django
In reply to this post by Django
#30701: Allowing patch_vary_headers() caching utility to handle '*' value.
-------------------------------------+-------------------------------------
     Reporter:  Alexander-TX         |                    Owner:  Adnan
         Type:                       |  Umer
  Cleanup/optimization               |                   Status:  closed
    Component:  Core (Cache system)  |                  Version:  master
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

 In [changeset:"6805c0f99f4790f28a97d597934d0877ba81dba9" 6805c0f9]:
 {{{
 #!CommitTicketReference repository=""
 revision="6805c0f99f4790f28a97d597934d0877ba81dba9"
 Fixed #30701 -- Updated patch_vary_headers() to handle an asterisk
 according to RFC 7231.
 }}}

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

--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.e20d0348f856111e5ffba95516e95af2%40djangoproject.com.