-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does superdeno intercept redirects? #6
Comments
Ah, interesting - great point! So it looks like superagent supports redirects (by default it will follow up to 5) (REF: https://visionmedia.github.io/superagent/#following-redirects) and so really we should be exposing the Will need to investigate whether we're re-exposing this functionality properly in SuperDeno - might require a fix in the (P.S. this is just a port of supertest - most credit should be directed there!) Let me know if you have any luck with using |
Started having more of a dig - it looks like the browser implementation that we are using for I'll make a stab at implementing it. |
Sorry to be the bearer of bad news, but unfortunately it looks like this would be no small task without change to the whatwg spec for fetch, and then that change implemented in Deno core. The easiest / main way to make a HTTP request in Deno is to use the Deno also has no intention to implement the What remains is to use a reasonably hand-crafted (non-standard) method of making HTTP requests such as how https://github.com/keroxp/deno-request or https://github.com/keroxp/deno-fetch has done it with Maybe I'll spike a branch, but feel a little hesitant to move away from using |
Yeah that's fair enough. Might be worth waiting until Deno implement XmlHttpReq and see where that goes. Appreciate the detailed insights on this. |
Hi! The Deno 1.6.0 release changed the behavior of fetch (REF), making it possible to test redirects. As an example, when a server at port 7777 redirects requests to path
The new behavior also provides an opportunity to step through redirects. The cors option used in superdeno continues to follow through redirects. Should I open a new issue asking for the possibility to test redirects in superdeno/superoak (e.g. by changing the default redirect behavior or by giving the users an option to input the redirect mode), or should we use this issue for following up? And, awesome work on superdeno & superoak! |
Oh wow! Completely missed this 😄 Clearly oogling too much at the LSP and Need to have a play around, but from what you describe I reckon we should be able to support the superagent Thanks for raising this @avihavai 💯 |
@avihavai, @viztastic support for a I hope this helps with any missing test coverage you might have! Please raise new issues if you have any problems with it 🙃 |
Awesome, this works brilliantly. Thanks a lot for the effort! |
Is there a way to test for redirects?
When I do something along the lines of:
This errors out and insists that the final state is 200, not 302.
I've noticed that the response.headers capture those of the final destination page rather than the actual API redirect state. Is there a way to go one step before the final destination URL?
I have also tried
but to no effect.
Thanks heaps (again great library).
The text was updated successfully, but these errors were encountered: