Skip to content
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

Support following fetch redirect responses #626

Closed
kettanaito opened this issue Sep 7, 2024 · 3 comments · Fixed by #627
Closed

Support following fetch redirect responses #626

kettanaito opened this issue Sep 7, 2024 · 3 comments · Fixed by #627
Assignees

Comments

@kettanaito
Copy link
Member

kettanaito commented Sep 7, 2024

There are instances where redirect responses to fetch requests aren't being followed:

Caution

Before fixing this, we need to write compliance tests for different request modules in accordance to how they follow or don't follow redirects. Note that not all request modules may have redirect following built-in. For example, I believe the http module doesn't do that, thus the existence of designated third-party modules just for that functionality.

Roadmap

  1. Add failing compliance tests for following redirect responses (can start from fetch). A good start: test: add mock redirect response tests for "axios" and "follow-redirects" #581
  2. Analyze existing solutions to learn how they implement redirect response following. Use Undici as an example, I believe it has that built-in.
  3. Implement the redirect following.
@kettanaito
Copy link
Member Author

Looks like the failing tests have been added already: #581. We may need more, but this is a good start.

@kettanaito
Copy link
Member Author

Added failing compliance tests for fetch here: #627

Confirm that Undici's fetch does follow redirect responses as described in the expected behavior.

@kettanaito kettanaito changed the title Support following redirect responses Support following fetch redirect responses Sep 7, 2024
@kettanaito
Copy link
Member Author

Released: v0.35.0 🎉

This has been released in v0.35.0!

Make sure to always update to the latest version (npm i @mswjs/interceptors@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

@kettanaito kettanaito mentioned this issue Sep 16, 2024
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant