Created
November 22, 2025 18:01
-
-
Save jpluimers/f017d1dd5573d523eba4807b7d233274 to your computer and use it in GitHub Desktop.
Unsuccessful Browser client side HTTP redirect checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var xhr = new XMLHttpRequest(); | |
| xhr.onload = function() { | |
| if (this.status < 400 && this.status >= 300) { | |
| console.log('request redirects to ' + this.getResponseHeader("Location")); | |
| } else { | |
| console.log('request does not redirect'); | |
| } | |
| } | |
| xhr.open('HEAD', 'https://t.co/Ui4Wmesq1j', true); | |
| xhr.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment