How to use 'responseurl' in JavaScript

Every line of 'responseurl' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
302function responseURL() {
303 if ('responseURL' in xhr) {
304 return xhr.responseURL
305 }
306
307 // Avoid security warnings on getResponseHeader when not allowed by CORS
308 if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
309 return xhr.getResponseHeader('X-Request-URL')
310 }
311
312 return;
313}

Related snippets