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

Don't overwrite the last redirected location #1589

Merged
merged 2 commits into from
Jun 16, 2023

Conversation

jimmy-park
Copy link
Contributor

Since redirection is handled recursively, multiple redirects result an invalid location which is the first redirected location. res.location is overwritten recursively.

Some test cases did not check the last location https://www.yahoo.com. They usually succeed even if they check the wrong location https://yahoo.com/. But sometimes they fail because http://yahoo.com redirects http://www.yahoo.com.

http://yahoo.com -> https://yahoo.com    -> https://www.yahoo.com
http://yahoo.com -> http://www.yahoo.com -> https://www.yahoo.com

@yhirose
Copy link
Owner

yhirose commented Jun 16, 2023

Thanks for fixing the bug!

@yhirose yhirose merged commit 4a61f68 into yhirose:master Jun 16, 2023
@jimmy-park jimmy-park deleted the fix-redirected-location branch June 17, 2023 01:53
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 this pull request may close these issues.

2 participants