Firefox vs. PRG
- 0
- Add a Comment
- No Related Post
Those of you within the Web app world undoubtedly have heard of Post/Redirect/Get. But did you know that sometimes Firefox can present challenges in this area?
Post/Redirect/Get (PRG) is a common web-application design pattern, where a server responds to an HTTP POST request not by generating HTML immediately, but by redirecting the browser to GET a different page. At the cost of an extra request, PRG allows users safely to bookmark, reload, etc.
When someone attempts to reload a page generated by a POST request, browsers will generally pop up a warning that reloading will cause a form to be resubmitted, possibly causing you to purchase two sports cars (etc.) — that warning is a good thing. Strangely, however, Firefox 1.5.03 will pop up the same warning after a PRG operation, when reloading should not cause anything bad to happen. I can think of a few possible reasons:
1. Firefox wants to repeat the entire PRG operation rather than just the final GET
2. Because the GET was the (indirect) result of a POST operation, Firefox still wants to warn you that there might be something fishy.
3. An obscure bug.I’m leaning towards #3, but I’m curious about whether anything thinks that Firefox is doing the right thing here, and whether other browsers (MSIE, Opera, Safari, etc.) act the same way. Source: Quoderat
[tags]firefox,prg,post request[/tags]
