Is it seriously impossible to make an ajax request and have it *not* follow redirects, but instead give you back a response object telling you where the server wanted to redirect you to?
-
Show this thread
-
-
Replying to @mountain_ghosts @sgrif
you have to invent your own redirect protocol inside of a 2xx response
1 reply 0 retweets 1 like -
Replying to @mountain_ghosts
Yeah, that's what I'm doing. It's just annoying AF. I'm changing this sign in form to be 2 step (determine if using SSO or not), would be nice if I could just leave all the existing `redirect_to`s alone and not rewrite the entire controller
1 reply 0 retweets 1 like -
Replying to @sgrif
I wonder if "location" is a protected header not visible to JS
1 reply 0 retweets 0 likes -
Replying to @mountain_ghosts
It's not, but your only options are "follow all redirects", "error", or "get back a thing that says we got a redirect response but does not let you inspect the response in any way shape or form"
1 reply 0 retweets 0 likes -
Replying to @sgrif @mountain_ghosts
> An opaque-redirect filtered response is a filtered response whose type is "opaqueredirect", status is 0, status message is the empty byte sequence, header list is empty, body is null, and trailer is empty. https://fetch.spec.whatwg.org/#concept-filtered-response-opaque …
1 reply 0 retweets 0 likes -
Replying to @sgrif
so it's like "uh, the server sent... something" "can I see it" "... no"
1 reply 0 retweets 0 likes
Yup. You can still give it back to the browser so it can follow the redirect later, but that's it.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.