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
Fix HTTP compression for HttpConnection HttpClient implementation (#3921)
* GzipStream was wrapping completed task handler not the writable stream
* Make sure HttpCompression is enabled randomly when running the integration tests
* Remove adding Accept-Encoding twice
This commit removes adding Accept-Encoding headers again, when constructing the requestMessage.
These headers are added by the default HttpClientHandler implementation, with AutomaticDecompression.
There is the possibility that a user overrides CreateHttpClientHandler() and does not set AutomaticDecompression, but does not override CreateRequestMessage(), and is relying on CreateHttpRequestMessage to add the Accept-Encoding headers when using HttpCompression. This commit will break that usage pattern, but I think this is acceptable to do, because we should optimize for the default behaviour i.e. we _could_ check that Accept-Encoding headers have been set when HttpCompression is enabled, inside CreateHttpRequestMessage(), and set them if not, but this is additional overhead to perform on every request. Instead, a user overriding CreateHttpClientHandler() and not setting AutomaticDecompression, and not overriding CreateRequestMessage(), when wishing to use HttpCompression, should set AutomaticDecompression inside their overridden implementation.
Fixes#3913
0 commit comments