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

Unable to redirect with content on Full Framework #644

Closed
sanyappc opened this issue Aug 19, 2021 · 3 comments
Closed

Unable to redirect with content on Full Framework #644

sanyappc opened this issue Aug 19, 2021 · 3 comments

Comments

@sanyappc
Copy link

sanyappc commented Aug 19, 2021

HttpClient disposes HttpContent after request on full framework (not core):
Why does HttpClient dispose HttpContent?
Stop disposing of request content in HttpClient

But FlurlRequest.ProcessRedirectAsync tries to reuse disposed content for redirect request and this leads to CapturedJsonContent disposed exception

@sanyappc sanyappc added the bug label Aug 19, 2021
@tmenier
Copy link
Owner

tmenier commented Aug 31, 2021

I'll look into this. Just so I can repro easily, what's the HTTP verb and status (3??) of the original (redirecting) call?

@sanyappc
Copy link
Author

it's PUT with 301

@tmenier
Copy link
Owner

tmenier commented May 7, 2022

Sorry to do this but I think I'm going to mark this a won't-fix. I looked into it and it would be quite an involved fix, I haven't heard about anyone else running into it, and as you noted it only affects people still on full Framework, which is becoming fewer and fewer in a .NET 6 world.

You've probably found a work-around by now, but I'd suggest either trying to recreate the content in the OnRedirect event (I'm honestly not sure it that'll work), or disable automatic redirects entirely and handle them manually. See #500.

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

No branches or pull requests

2 participants