Hey Daniel,

Thanks for the reply. Unfortunately doing this in a custom middleware is 
not an option, as the this processing needs to take place at a very low 
level, at the point where the Request object is being built. By the time 
the request is passed in to the middleware layers for processing, the 
cookies would already have been lost.

Will

On Friday, February 5, 2016 at 12:31:30 AM UTC+1, Daniel Chimeno wrote:
>
> Hello, 
>
>>
>> I have resolved this in my instance as follows in django/http/cookie.py:
>>
>> def parse_cookie(cookie):
>>     cookie = re.sub('[^\x20-\x7e]+', 'X', cookie)
>>     ...
>>
>>
>>
>> It would be preferable to write that code in a middleware than in the 
> Django code itself.
> Before the middleware that handles the cookie (I guess it would be 
> Session), you can *sanitize* that cookie.
>
> Hope it helps.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/08dde6a1-1eb8-4428-906b-f619947ea8b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to