public static CompressionSupport GetCompressionSupport(this HttpResponse response) { string acceptEncoding = response.Headers[HttpExtensions.RequestCompressionHeaderKey]; if (response.MimeTypeSupportsCompression()) { if (acceptEncoding.Contains(HttpExtensions.DeflateIdentifier1) || acceptEncoding == HttpExtensions.DeflateIdentifier2) { return(CompressionSupport.Deflate); } else if (acceptEncoding.Contains(HttpExtensions.GZipIdentifier1)) { return(CompressionSupport.GZip); } } return(CompressionSupport.None); }