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
HttpClient GetAsync - The server returned an invalid or unrecognized response #20791
Comments
The response header:
should be:
|
@stephentoub
|
I would be really careful about this. We need to constrain that type of loose parsing. I would definitely compare to what .NET Framework and perhaps other HTTP stacks do regarding this type of thing. |
Not in the request, in the response: this isn't about the code you're writing, rather the server is sending back an invalid response.
Ok. This example fails on all three of the .NET Framework, .NET Core on Windows, and .NET Core on Unix.
From the output shown in the original issue post, it looks like curl allows it through. |
@stephentoub Got it. Thank you.
Yes, CURL allow this and works fine. |
@davidsh, I removed the |
The server is violating the RFC by sending out a response header that is malformed. The behavior is consistent between .NET Framework and .NET Core. And even if we wanted to change the behavior to be more loose in parsing, we can't change the OS WinHTTP behavior easily. So, closing this issue as by-design. |
Version - .Net Core 1.0.1
OS - CENT OS.7 64 bit / Azure
Curl version
When I make a request to http://www.pma.org/home/default.asp? URL I get the following error in my .Net Core App. However, If I make the request using Curl works fine.
Sample code
Curl request
Curl response
What's the problem?
The text was updated successfully, but these errors were encountered: