HttpClient does not automatically follow https to http redirects #108588
Open
Description
Description
https to http are not automatically followed even though the documentation states they should: https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.allowautoredirect?view=net-8.0#remarks
Reproduction Steps
Clone this repo: https://github.com/jordinl/http-client-redirect-bug and execute it.
Expected behavior
Fetching https://verizon.com should return 200 status code and response URL https://www.verizon.com/
Actual behavior
Fetching https://verizon.com returns 301 status code and location header: http://verizon.com/
Regression?
No response
Known Workarounds
No response
Configuration
- .NET 8 and 9
- OS: Linux 6.10 / Fedora 39
- Arch: x86_64
Other information
No response
Activity