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)
Changed 4 years ago by vkryachko
comment:1 Changed 4 years ago by lukeplant
- Has patch set
- Keywords regression added
- Needs documentation unset
- Needs tests set
- Patch needs improvement set
- Triage Stage changed from Unreviewed to Accepted
comment:2 Changed 4 years ago by lukeplant
- Resolution set to fixed
- Status changed from new to closed