Issue with redefined SimpleCookie with invalid cookie name
|Reported by:||Owned by:||Ivan Kolodyazhny|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Description (last modified by )
To provoke the error:
from django.http import HttpResponse response= HttpResponse() response.set_cookie("a:.b/",1) > AttributeError: 'SimpleCookie' object has no attribute 'bad_cookies'
with a python version that does not accept colons (":") in the cookie name.
Django http/init.py redefines the SimpleCookie, and initializes
bad_cookies in a method
load(self, rawdata) that does not seem to be called in this case.
Beside the obvious fact that the cookie name is totally invalid, it looks like
bad_cookies is not correctly initialized (I wouldn't mind an error, but a real one!)
Or am I using set_cookie uncorrectly here?
Change History (8)
comment:3 Changed 3 years ago by
|Owner:||changed from nobody to Ivan Kolodyazhny|
|Status:||new → assigned|