Use top url on redirections

This commit is contained in:
Xavier Guimard 2015-12-16 20:44:26 +00:00
parent 5decea40d8
commit a3f61ccebd

View File

@ -203,8 +203,9 @@
// data / status / config / statusText / headers()
var url = rejection.headers();
if (rejection.status == 401 && url.authorization && url.authorization.match(/^http/)) {
/* TODO: replace this with a popup */
window.location = url.authorization;
var u = url.authorization.replace(/url=.*$/g, '');
u += 'url=' + window.btoa(window.location).replace(/\//, '_');
window.location = u;
} else {
alert(rejection.statusText ? rejection.statusText : 'Network problem');
}