only re-route on error if the window.location matches the xhr api call (fix regression introduced in 43ed54ac8f5747089f01bc94bccc3751b15778fd)