Please sign in to comment.
Don't support pushState when the original request method was anything…
… other than GET We cannot use pushState if the initial request method is a POST for two reasons: 1. Up.js replaces the initial state so it can handle the pop event when the user goes back to the initial URL later. If the initial request was a POST, Up.js will wrongly assumed that it can restore the state by reloading with GET. 2. Some browsers have a bug where the initial request method is used for all subsequently pushed states. That means if the user reloads the page on a later GET state, the browser will wrongly attempt a POST request. Modern Firefoxes, Chromes and IE10+ don't seem to be affected by this, but we saw this behavior with Safari 8 and IE9 (IE9 can't do pushState anyway). The way that we work around this is that we don't support pushState if the initial request method was anything other than GET (but allow the rest of the Up.js framework to work). This way Up.js will fall back to full page loads until the framework was booted from a GET request.
- Loading branch information...
Showing with 70 additions and 10 deletions.
|@@ -1,4 +1,5 @@|
File renamed without changes.
|@@ -0,0 +1,28 @@|
|COOKIE_NAME = '_up_request_method'|
|cookies[COOKIE_NAME] = request.request_method|