Skip to content

Commit a6c02fd

Browse files
committed
Fixed an issue where an invalid accept encoding would throw an exception.
1 parent 0414183 commit a6c02fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Api/Utility/EncodingDelegatingHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage reques
2929
&& response.RequestMessage.Headers.AcceptEncoding.Count > 0) {
3030
string encodingType = response.RequestMessage.Headers.AcceptEncoding.First().Value;
3131

32-
if (response.Content != null)
32+
if (response.Content != null && (encodingType == "gzip" || encodingType == "deflate"))
3333
response.Content = new CompressedContent(response.Content, encodingType);
3434
}
3535

0 commit comments

Comments
 (0)