azzlack / Microsoft.AspNet.WebApi.MessageHandlers.Compression

Drop-in module for ASP.Net WebAPI that enables GZip and Deflate support
Apache License 2.0
194 stars 54 forks source link

Compression doesn't work with Chrome browser #63

Closed CSharpBender closed 4 years ago

CSharpBender commented 4 years ago

Compression doesn't work when AppleWebKit is found in the User-Agent header. Chrome is sending by default: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36

Using fiddler I noticed that the response is uncompressed although the response header has X-Content-Encoding-Over-Network: gzip. Removing AppleWebKit from User-Agent fixes the issue.

CSharpBender commented 4 years ago

After googling I found that others had the same issue and it was because of the antivirus.