cljs-ajax icon indicating copy to clipboard operation
cljs-ajax copied to clipboard

Redirect behaviour

Open TimoKramer opened this issue 4 years ago • 3 comments

Hi,

I am using cljs-ajax on a CLJ-project. I am requesting something from an API and it should return a 307 temporary redirect. The redirect location does return a url that does not accept the authentication headers that I needed for the original request. So I want to get the answer back extract the location and start a new request without the headers.

It seems to me that cljs-ajax does automatically resolve the redirect. Is this correct? How can I avoid that?

Thanks!

TimoKramer avatar Dec 02 '20 15:12 TimoKramer

So here we run into one of the big problems with the project: there's no automated integration tests. I think the problem you're encountering is this: https://stackoverflow.com/questions/46993271/cors-ajax-or-xmlhttprequest-type-get-with-authorization-get-error-307

Without a decent way of reproducing the problem, though, I'm a little stuck.

JulianBirch avatar Feb 17 '21 19:02 JulianBirch

Some reproduction available here: https://gist.github.com/TimoKramer/c61a457a0bca15273fb777bc3c781552

TimoKramer avatar Feb 18 '21 08:02 TimoKramer

Yeah, the challenge is turning that into something that runs as a test during the travis build, for both Java and JavaScript. It's a big deal, sadly.

JulianBirch avatar Feb 18 '21 12:02 JulianBirch