Description
Upstream CEF issue:
https://bitbucket.org/chromiumembedded/cef/issues/1420/issues-with-back-forward-reload-on-post
Issue reported on CEF Forum:
http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=12238
During testing of POST requests for pretty urls, a new bug was found. When doing a post request to a non-pretty url, and later navigation Back and Forward in history using mouse context menu, an error occurs:
Loading error (-400).
The message above is outputted in ClientHandler::OnLoadError()
.
The meaning of -400 error in Chromium:
// The cache does not have the requested entry.
NET_ERROR(CACHE_MISS, -400)
There seem to be two solutions
a) Find a way to resent the POST request
b) Handle -400 error by navigating Back in history. Unfortunately it makes any Forward navigation not possible if there was a POST request made at some point.
Solution b) does not work. The steps are:
- GET index.php
- GET pretty-urls.php
- POST pretty-urls.php
- Back() to GET pretty-urls.php
- Forward() to POST pretty-urls.php - this Back() in OnLoadError and causes a redirect to 1) GET index.php
Step 5) should cause stepping back to step 2) to GET pretty-urls.php. Maybe it should be browser->Reload() called in step 5 instead of Back()?
By doing Reload() in step 5) it is step 3) POST that is repeated. And step 2) completely disappears from navigation history. Going Back() after step 5) takes back to step 1) GET index.php. Now, doing a forward makes it to step 3). Step 2) is lost.
Partially fixed in revision 5a4ac25. There are still problems as some of the entries in navigation history are lost. It gets rid of the "-400 Loading error" being displayed to user. And POST request is resent properly when navigating in history.
Original issue reported on code.google.com by [email protected]
on 28 Oct 2014 at 9:43