We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
HttpWebRequest.MaximumResponseHeadersLength accepts -1 as value on desktop CLR
HttpWebRequest.MaximumResponseHeadersLength
However on corefx any value lower then 0 throws.
0
https://github.com/dotnet/corefx/blob/72119235e294e711871cf453f2ffc66ba17ff23b/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L166
Is this by design?
The text was updated successfully, but these errors were encountered:
I guess you should add a repro and/or specify the version you're using.
HttpWebRequest hwr = WebRequest.CreateHttp("https://www.github.com"); hwr.MaximumResponseHeadersLength = -1;
works fine for me on netcoreapp2.1, as System.Threading.Timeout.Infinite = -1
Sorry, something went wrong.
@Mpdreamz does it break any real-world scenarios / applications?
@Mpdreamz Do you actually see this bug by running code? Or just by inspecting the sources?
The source code you reference above is doing the right thing:
if (value < 0 && value != System.Threading.Timeout.Infinite)
System.Threading.Timeout.Infinite is equal to -1: https://docs.microsoft.com/en-us/dotnet/api/system.threading.timeout.infinite?redirectedfrom=MSDN&view=netframework-4.7.2
System.Threading.Timeout.Infinite
So, this code doesn't actually throw any exception. And it works the same on .NET Core as .NET Framework:
Let us know if you can repro the exception you are talking about.
No branches or pull requests
HttpWebRequest.MaximumResponseHeadersLength
accepts -1 as value on desktop CLRHowever on corefx any value lower then
0
throws.https://github.com/dotnet/corefx/blob/72119235e294e711871cf453f2ffc66ba17ff23b/src/System.Net.Requests/src/System/Net/HttpWebRequest.cs#L166
Is this by design?
The text was updated successfully, but these errors were encountered: