#32191: Not RFC 6265 compliant cookies in contrib.messages.
----------------------------------+------------------------------------
     Reporter:  Nico Giefing      |                    Owner:  nobody
         Type:  Bug               |                   Status:  new
    Component:  contrib.messages  |                  Version:  3.1
     Severity:  Normal            |               Resolution:
     Keywords:  Cookie malformed  |             Triage Stage:  Accepted
    Has patch:  0                 |      Needs documentation:  0
  Needs tests:  0                 |  Patch needs improvement:  0
Easy pickings:  0                 |                    UI/UX:  0
----------------------------------+------------------------------------

Comment (by Craig Smith):

 I have implemented the initial approach according to the comment above.
 One thing to note is that when the cookie is accessed through the value
 attribute, it will need  an `unquote`, for cases like
 `req.cookies['messages'].value`.

 This could be attempted with a property to manage access to the `value`
 attribute to apply the unquote in there, so that any client code that uses
 that method of access can remain unchanged.

 The compression has proved to be a bit tricky, due to changing between
 bytes and strings, but the approach that I am taking is to factor out the
 compression code from `signing.dumps` and `loads` into `signing.compress`
 and `decompress`.

 It was encouraging to see swapping the `quote` `unquote` for
 `singing.dumps` `signing.loads` works out of the box, if we want all our
 message cookies timestamped, which I assume that we don't. But anyway,
 that works. I'll be back on the case later this week. Thanks for your
 tips, PR forthcoming.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32191#comment:12>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.d5880a65baedb5e6273bf13287d471a7%40djangoproject.com.

Reply via email to