POST data handling bug
|Reported by:||vkryachko||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||yes||Patch needs improvement:||yes|
django.http.HttpRequest._load_post_and_files() has a bug, which was introduced after 1.2. The problem is that POST does not get populated if request.raw_post_data has been accessed before it.
To reproduce it:
def my_view(request,*args,**kwargs): raw_post = request.raw_post_data post = request.POST # post is an empty QueryDict
I think he problem here is in this condition http://code.djangoproject.com/browser/django/trunk/django/http/__init__.py#L265 , which to me makes sense only in multipart request.
I've attached a patch to fix it.
Change History (4)
comment:1 Changed 6 years ago by
|Patch needs improvement:||set|
|Triage Stage:||Unreviewed → Accepted|