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

Redirects in .NET Core fails to fetch the OpenGraph data and throws an exception #35

Open
Mzril opened this issue Jun 6, 2024 · 0 comments

Comments

@Mzril
Copy link

Mzril commented Jun 6, 2024

Describe the bug
When calling ParseUrlAsync on a url that has a Location header from https to http, an exception is thrown, due to .NET core AllowAutoRedirect not following those redirects. See https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.allowautoredirect?view=net-8.0

To Reproduce
Steps to reproduce the behavior:

  1. Install .NET Core, and this package
  2. Call .ParseUrlAsync on a url such as "https://ygtreasureus.com/" that redirects into "http://www.ygtreasureus.com"
  3. See error

Expected behavior
ParseUrlAsync should not throw the exception, a custom redirecting HttpHandler would be required due to .NET Core not having an option for "DangerousAllowAutoRedirect" see dotnet/runtime#28039

Ideally, an option or a set of options allows us to inject a custom httphandler to the httpdownloader, or there's a flag we can provide to allow for dangerous redirects by the package.

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

No branches or pull requests

1 participant