-
Notifications
You must be signed in to change notification settings - Fork 43
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
"infinite redirection loop detected" error on many websites, but Firefox and curl work fine #49
Comments
This seems to work as intended. Firefox does indeed show a page, but I can't figure out where it gets the page from. Maybe it reads the body of the 301 and simply displays that after N loops? Curl, on the other hand, seems to simply return the 301. I tested the following manually with curl (from the .tar.gz):
|
You need to pass the My full testing setup (including for curl) can be found here: https://github.com/Shnatsel/rust-http-clients-smoke-test |
I have debugged this problem a bit and think I have found the cause. These servers seem to match the host and depending on that redirect the user to URLs. In this case the server recognizes the host "example.org:443" and wants to forward to "example.org". minreq then tries to follow this and sends another request with "example.org:443". This starts the fun all over again. I quickly wrote a patch, joeried@258500b |
Oh, that's definitely an issue. Thanks for investigating, I was stumped! Your patch would work for this specific issue, but I think this should be fixed in an architectural way: |
The solution you propose is probably much nicer, because it eliminates unnecessary adding/removing of the port. By the way, it looked yesterday like my proof of concept solution would also solve #48 (at least for the one URL given) |
Thanks for the heads up! #48 is such an odd issue that I could see this fixing it, maybe some https servers don't like weird hostnames. |
Tested this, 318d2d2 seems to indeed fix the issue. |
On some websites, e.g. http://mockup.love, minreq fails with the following error:
Firefox and curl work fine.
80,000+ websites out of the top million from Feb 3 Tranco list are affected.
Tested using this code. Test tool output from all affected websites: minreq-infinite-redirection.tar.gz
I admit, I am a bit surprised to see a check for this particular condition as opposed to simply setting a limit on the number of redirections.
The text was updated successfully, but these errors were encountered: