#15679 closed (fixed)
POST data handling bug
Reported by: | vkryachko | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Keywords: | regression | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | yes | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | patch.diff added |
---|
comment:1 by , 14 years ago
Has patch: | set |
---|---|
Keywords: | regression added |
Needs tests: | set |
Patch needs improvement: | set |
Triage Stage: | Unreviewed → Accepted |
Note:
See TracTickets
for help on using tickets.
Accepted. I think the correct fix is something more like replacing:
with
in
_load_post_and_files
.However, this still has a bug in that method if: