Add checks for XHR redirects (#101)

Fixes #7

This checks for redirects by looking for the following, in sequence:
- XMLHttpRequest.responseURL
- the X-PJAX-URL header (like jquery-pjax)
- the X-XHR-Redirected-To header (like Turbolinks)
This commit was merged in pull request #101.
This commit is contained in:
BehindTheMath
2018-01-10 15:45:55 -05:00
committed by GitHub
parent cb9c37fcb3
commit 6fa51e58f8
2 changed files with 18 additions and 1 deletions

View File

@@ -15,6 +15,11 @@ module.exports = function(location, options, callback) {
}
}
request.onerror = function(e) {
console.log(e)
callback(null, request)
}
request.ontimeout = function() {
callback(null, request)
}