Code

Opened 9 years ago

Closed 9 years ago

#370 closed defect (duplicate)

Omitting terminal slash in form action breaks POST data due to redirect

Reported by: mrtact@… Owned by: adrian
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: UI/UX:

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.

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by jacob

  • Resolution set to duplicate
  • Status changed from new to closed

This is a duplicate of #277.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.