Opened 19 years ago
Closed 19 years ago
#370 closed defect (duplicate)
Omitting terminal slash in form action breaks POST data due to redirect
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Core (Other) | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Steps to repro
- Add an urlpattern to your app like so:
(r'^search/$', 'search'),
- Add a search view that spits out debugging info:
def search(request): return HttpResponse(linebreaks(escape(request)))
- Create a form that submits to this view:
<form method="POST" action="/search"> <!-- Note missing terminal / -->
- Test the form.
Expected
Any data submitted via the form show up as key:value pairs in the request.POST.
Actual
The POST is empty, because the framework redirects the POST without the slash to the slashified URL as a GET. It should probably detect the POST and forward the dict full of useful form data.
Note:
See TracTickets
for help on using tickets.
This is a duplicate of #277.