You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting "Error parsing HTTP message header byte 2048 of message System.Byte[]" error when deserializing HttpRequestMessage, asking to get HTTP header line size limit to match whatever limits are in place for HttpRequestMessage and serialization
When calling the method 'HttpContentMessageExtensions.ReadAsHttpRequestMessageAsync' (https://docs.microsoft.com/en-us/previous-versions/aspnet/hh834457(v%3dvs.118)) in System.Net.Http.Formatting to deserialize an HTTP message, I am sometimes getting the error "Error parsing HTTP message header byte 2048 of message System.Byte[]".
This HTTP header line size is not a value that can be adjusted by any of the method's input parameters.
If this value is going to be hard-coded (and the user is not able to pass them in), it would be great if it could at least honor the HTTP header line size limits for the actual HTTP request message object, and the limits for the serialization. (Why are we able to populate an obj with HTTP headers this size, and serialize it without any error but deserialization gets an error?)
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
#312)
* Configure max request line size limits to be the same as maxHeaderSize
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
Getting "Error parsing HTTP message header byte 2048 of message System.Byte[]" error when deserializing HttpRequestMessage, asking to get HTTP header line size limit to match whatever limits are in place for HttpRequestMessage and serialization
When calling the method 'HttpContentMessageExtensions.ReadAsHttpRequestMessageAsync' (https://docs.microsoft.com/en-us/previous-versions/aspnet/hh834457(v%3dvs.118)) in System.Net.Http.Formatting to deserialize an HTTP message, I am sometimes getting the error "Error parsing HTTP message header byte 2048 of message System.Byte[]".
This HTTP header line size is not a value that can be adjusted by any of the method's input parameters.
If this value is going to be hard-coded (and the user is not able to pass them in), it would be great if it could at least honor the HTTP header line size limits for the actual HTTP request message object, and the limits for the serialization. (Why are we able to populate an obj with HTTP headers this size, and serialize it without any error but deserialization gets an error?)
Someone else with same issue: https://forums.asp.net/t/2037342.aspx?Max+header+size+when+serializing+HttpMessageContent
The text was updated successfully, but these errors were encountered: