Uh oh!
There was an error while loading. Please reload this page.
Follow redirects - #2058
Conversation
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
rassilon
commented
Jul 25, 2023
@alexeyzimarev , did you think about maybe borrowing RedirectHandler from net core here? i.e.: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs it might make the weird edge cases simpler to deal with... Having said that, i'll submit what I have so far in terms of improvements shortly. |
rassilon
commented
Jul 25, 2023
I've added a POST -> GET redirect with recieving cookies during the original 302 redirect response test to #2119. |
rassilon
commented
Aug 17, 2023
@alexeyzimarev , would you like me to try doing a set of your and my changes for follow redirects on top of the merged PR #2056? |
alexeyzimarev
commented
Aug 20, 2023
@rassilon I actually didn't check the default implementation in the socket message handler, thanks for the links. My idea was more or less to follow, at least from settings perspective, the Flurl path. They have things like allow redirecting from https to http, something that just doesn't work with HttpClient. I haven't looked at your PR yet, will check soon, and big thanks for this contribution. It would be great to resolve the redirect issue. |
rassilon
commented
Aug 20, 2023
Ahh.. I see what you mean by Flurl.. very neat idea. Would you want to add settings for each of the decisions in the socket message handler? Or support the simpler approach Flurl uses? Which is apparently at: https://github.com/tmenier/Flurl/blob/dev/src/Flurl.Http/FlurlClient.cs#L162 atm. (i.e. a simple settings object and an event handler) |
rassilon
commented
Aug 20, 2023
I can give a whirl at making some more progress on this next week if you have other higher priority fish to fry. |
alexeyzimarev
commented
Aug 22, 2023
We can't use the socket message handler anyway as it's only .NET 5+, or wrap the handler instantiation in pragma (also an option). But anyway, yes, I just want to make own decisions as I mentioned #2059 (comment) |
Description
Fixes#2059
Implement custom follow redirect functionality instead of relying on the message handler as it has limitations described in the issue.
Purpose
This pull request is a: