question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[XMLHttpRequest] Making HTTP requests to redirects.

See original GitHub issue

I’m in the process of implementing an login against an oauth based third-party server. As part of the login procedure I need to make an HTTP requests to an endpoint that returns a 302 status code with new Location header and vital session cookies that I need to intercept. Unfortunately the XMLHTTPRequest and the fetch API will automatically follow these redirect so there is no way of accessing or intercepting the required HTTP headers that contain authorization information.

So what I would like to suggest is:

  • Add a non standard nofollow = true property to these API’s so we as users can handle the redirect logic our selfs.
  • Provide a much lower level HTTP interface much like Node’s http module so we can build our own requests modules and use the modules such as request from npm.
  • Provide a tcp interface so we can add HTTP parsing and WebSocket frame parsing on top of it.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
3rd-Edencommented, Sep 28, 2017

Yes the issue is not fixed, it just get automatically closed for some odd reason even though it’s valid report.

1reaction
mkonicekcommented, Mar 16, 2016

Hi there! This issue is being closed because it has been inactive for a while.

But don’t worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/xmlhttprequest-making-http-requests-to-redirects

ProductPains helps the community prioritize the most important issues thanks to its voting feature. It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix. We rely on the community to provide bugfixes as the core team is focused on performance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent redirection of Xmlhttprequest - Stack Overflow
If the response is an HTTP redirect: If the origin of the URL conveyed by the Location header is same origin with the...
Read more >
XMLHttpRequest.responseURL - Web APIs - MDN Web Docs
The read-only XMLHttpRequest.responseURL property returns the serialized URL of the response or the empty string if the URL is null.
Read more >
FollowRedirects in XMLHttpRequest - APIs - WICG
My proposal is to add back in the optional flag into XMLHttpRequest which would let the developer opt out of following redirects; perhaps ......
Read more >
How to make HTTP requests using XMLHttpRequest (XHR)
To send an HTTP request using XHR, create an XMLHttpRequest object, open a connection to the URL, and send the request. Once the...
Read more >
XMLHttpRequest synchronous request not handling redirects ...
The asynchronous request executes correctly (ends with code 200 after following the redirect). ... possible. When accessing 'http://google.com' you'll get a 301 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found