Skip to content

HttpClient does not automatically follow https to http redirects #108588

Open
@jordinl

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-System.Net.HttpdocumentationDocumentation bug or enhancement, does not impact product or test codehelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions