Description
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