-
Notifications
You must be signed in to change notification settings - Fork 253
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
HttpRequestMessage gets reused multiple times which is not supported with the SocketHttpHandler #8661
HttpRequestMessage gets reused multiple times which is not supported with the SocketHttpHandler #8661
Comments
@zivkan - related to some of the issues you are seeing? |
no. SocketHttpHandler is the new HttpClient code in .NET Core 2.1. I've been testing exclusively on .NET Framework, which uses the WinHttpHandler. |
@zivkan - assigning this issue to you, as it appears to affect GPR scenarios. See https://github.com/dotnet/corefx/issues/25163#issuecomment-538009706 |
We're reverting the first PR that closed this issue, due to the problems it introduced in .NET Core 3. The team's not comfortable with using and supporting reflection, so we'd like to investigate another long term fix, rather than patching the reflection issue.. Reopening this issue as it needs to be addressed again. |
This issue needs to be reopened now that the original fix was reverted. |
The
SocketHttpHandler
does not support reusing HttpRequestMessages multiple times. This can lead to issues with authentification if the user provides the wrong credentials the first time, because theAuthorization
header gets added by theSocketHttpHandler
and is resend on the next try. In combination with some servers (e.g. the GitHub NuGet feed) this results in an loop where each time the same credentials are being passed in because this server does not send aWww-Authenticate
header if anAuthorization
header is provided and so the new credentials are never added.To prevent this issue it is currently possible to disable the
SocketHttpHandler
which I have done here NuGetPackageExplorer/NuGetPackageExplorer#841See also https://github.com/dotnet/corefx/issues/25163#issuecomment-538009706
Sample Project
The text was updated successfully, but these errors were encountered: