DecompressionHandler will replace the Content on the HttpResponseMesasge with a new one wrapping the decompression stream. It also copies over all the headers from the response.
|
Headers.AddHeaders(originalContent.Headers); |
Since DecompressionHandler is internal and the user can never observe the original response content, we could assign the header collection to the new content instead of copying all the values.
We do something similar for trailing headers already:
|
internal void StoreReceivedTrailingHeaders(HttpResponseHeaders headers) |
DecompressionHandlerwill replace theContenton theHttpResponseMesasgewith a new one wrapping the decompression stream. It also copies over all the headers from the response.runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/DecompressionHandler.cs
Line 121 in 59b55a2
Since
DecompressionHandleris internal and the user can never observe the original response content, we could assign the header collection to the new content instead of copying all the values.We do something similar for trailing headers already:
runtime/src/libraries/System.Net.Http/src/System/Net/Http/HttpResponseMessage.cs
Line 121 in 59b55a2