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: mrtact@… 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

  1. Add an urlpattern to your app like so:
    (r'^search/$', 'search'), 
    
  2. Add a search view that spits out debugging info:
    def search(request):
        return HttpResponse(linebreaks(escape(request)))
    
  3. Create a form that submits to this view:
    <form method="POST" action="/search"> <!-- Note missing terminal / -->
    
  4. 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.

Change History (1)

comment:1 by Jacob, 19 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #277.

Note: See TracTickets for help on using tickets.
Back to Top