Merge pull request #4120 from kinglozzer/pulls/x-reload-absolute-urls

FIX: X-Reload & X-ControllerURL didn't support absolute URLs (fixes #4119)
This commit is contained in:
Damian Mooyman 2015-04-29 09:38:13 +12:00
commit e393a30d0f

View File

@ -633,8 +633,11 @@ jQuery.noConflict();
// Support a full reload // Support a full reload
if(xhr.getResponseHeader('X-Reload') && xhr.getResponseHeader('X-ControllerURL')) { if(xhr.getResponseHeader('X-Reload') && xhr.getResponseHeader('X-ControllerURL')) {
document.location.href = $('base').attr('href').replace(/\/*$/, '') var baseUrl = $('base').attr('href'),
+ '/' + xhr.getResponseHeader('X-ControllerURL'); rawURL = xhr.getResponseHeader('X-ControllerURL'),
url = $.path.isAbsoluteUrl(rawURL) ? rawURL : $.path.makeUrlAbsolute(rawURL, baseUrl);
document.location.href = url;
return; return;
} }