Skip to content
Snippets Groups Projects
Commit b6b2b857 authored by Jared Hancock's avatar Jared Hancock
Browse files

pjax: Fix confusing POST resubmit

If an agent submits a page via a POST (like updating settings in the admin
panel or creating a ticket) and navigates away via PJAX, if the browser
refresh button were clicked sometime later, the browser would prompt the
user to resubmit the POST data.

This patch avoids the issue by setting the browser's current URL to itself,
which magically clears the POST data.

The proper fix for the issue would be with
[Post/Redirect/Get](http://en.wikipedia.org/wiki/Post/Redirect/Get) method,
which would redirect the browser to a page it could GET after a successful
POST. Therefore a subsequent GET would reload the GET request, not the POST.
However, that would be too much of an edit for now.

References:
http://stackoverflow.com/a/6077822/1025836
http://en.wikipedia.org/wiki/Post/Redirect/Get
parent 51a71ce7
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment