Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MINOR Normalize trailing slashes in X-ControllerURL handling to avoid…

… double requests caused by SS_HTTPRequest modifying the original URL (removing trailing slash etc)
  • Loading branch information...
commit ac6f9e998750a8e4bfaf74927390b97680a2756b 1 parent c2b7416
Ingo Schommer chillu authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 admin/javascript/LeftAndMain.js
8 admin/javascript/LeftAndMain.js
View
@@ -38,8 +38,12 @@ jQuery.noConflict();
// Simulates a redirect on an ajax response - just exchange the URL without re-requesting it.
// Causes non-pushState browser to re-request the URL, so ignore for those.
if(window.History.enabled && !History.emulated.pushState) {
- var url = xmlhttp.getResponseHeader('X-ControllerURL');
- if(url) window.History.replaceState({}, '', url);
+ var url = xhr.getResponseHeader('X-ControllerURL');
+ // Normalize trailing slashes in URL to work around routing weirdnesses in SS_HTTPRequest.
+ var isSame = (url && History.getPageUrl().replace(/\/+$/, '') == url.replace(/\/+$/, ''));
+ if(isSame) {
+ window.History.replaceState({}, '', url);
+ }
}
},
error: function(xmlhttp, status, error) {
Please sign in to comment.
Something went wrong with that request. Please try again.