Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

pranavkm
Copy link
Contributor

As part of ReadAsHttpRequestMessageAsync, the parsing of the HTTP request line is limited
by a non-configurable 2k limit. The size does not affect buffer sizes, only the maximum allowed length.

This PR updates the ReadAsHttpRequestMessageAsync API to use the same limits for HTTP request line
as the HTTP header line, the latter which is configurable by user code.
In the default case, this means the HTTP request line size now supports a 16k limit before it throws.

Fixes #307

As part of ReadAsHttpRequestMessageAsync, the parsing of the HTTP request line is limited
by a non-configurable 2k limit. The size does not affect buffer sizes, only the maximum allowed length.

This PR updates the ReadAsHttpRequestMessageAsync API to use the same limits for HTTP request line
as the HTTP header line, the latter which is configurable by user code.
In the default case, this means the HTTP request line size now supports a 16k limit before it throws.

Fixes #307
Assert.Equal(HttpMethod.Get, httpRequestMessage.Method);
Assert.Equal("/", httpRequestMessage.RequestUri.PathAndQuery);
Assert.Equal("msdn.microsoft.com", httpRequestMessage.Headers.Host);
IEnumerable<string> actualCookieValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bet you're missing out var 😀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that and it does not work in C# 5. This is like getting -ve 💯 points.

@pranavkm pranavkm merged commit ef4296e into release/3.2.8 Jan 14, 2022
@pranavkm pranavkm deleted the prkrishn/307 branch January 14, 2022 21:47
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

Successfully merging this pull request may close these issues.

Increase HTTP header line size limit during deserialization of HttpRequestMessage
3 participants