In response header Content-encoding: gzip is present, but in request header Accept-encoding: gzip, deflate is missing

seemaA

In request header Accept-encoding: gzip, deflate, is missing, but in response header Content-encoding: gzip is present. does it cause compression failed. if yes, how to avoid it??

Request URL: http://something.com/something.js

Request Method: GET

Status Code: 200 OK 200 OK

Request Headers

Accept:  */*
Referer:  somthing.comsomthing.aspx
User-Agent:  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36
X-DevTools-Emulate-Network-Conditions-Client-Id:  2D3ED9B5-95BD-4984-9EEE-405C2889F11E

Response Headers

Accept-Ranges:  bytes
Content-Encoding:  gzip
Content-Length:  884
Content-Type:  application/x-javascript
Date:  Tue, 28 Oct 2014 11:09:13 GMT
ETag:  "0ac99ce3e9fcf1:0"
Last-Modified:  Mon, 14 Jul 2014 08:37:12 GMT
Server:  Microsoft-IIS/8.0
Vary:  Accept-Encoding
X-Powered-By:  ASP.NET
Jeroen Mostert

From RFC 7231:

A request without an Accept-Encoding header field implies that the user agent has no preferences regarding content-codings. Although this allows the server to use any content-coding in a response, it does not imply that the user agent will be able to correctly process all encodings.

In short: if you specify no Accept-Encoding, it's legal (though ill-advised) for the server to send you compressed content. There doesn't appear to be a solid, reliable way to tell a web server that it should definitely not compress. You can try Accept-Encoding: *;q=0 or Accept-Encoding: identity, but support for this is not universal across web servers, and proxies can mess things up as well.

In the end you are probably better off with simply handling compressed content if it comes back as such -- there is no good reason for a client to not support compression and libraries for this are freely available.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Missing content-encoding in Response Header for Request headers with accept-encoding: gzip, deflate, br (in that precise order) for HTTPS Requests

Detect gzip encoding to manually decompress response, but 'Content-Encoding' header missing

x-gzip token in accept encoding header

How to correctly define Accept-Encoding: gzip header in RAML?

Why cant I see the Content-Encoding: gzip response in my c# HttpClient response header?

Content-Encoding: gzip + Transfer-Encoding: chunked with gzip/zlib gives incorrect header check

Tomcat Compression Does Not Add a Content-Encoding: gzip in the Header

Accept-Encoding: gzip on iOS

is there any built in filter in istio or in spring webflux handling header "Content-Encoding: deflate" to decompress the request body

POST responses not compressed despite Accept-Encoding Header being present in a request

Django rest framework, set the api response Content-Encoding to gzip

Manual gzip encoding for CamelMessage Response (Content-Length mismatches)

Transfer-Encoding: gzip vs. Content-Encoding: gzip

Accept gzip encoding using httr R

Nginx on docker - Vary: Accept-Encoding header is missing

Having trouble getting content-encoding to show up in response header for get request

How to decode "Content-Encoding: gzip, gzip" using curl?

Go net/http Transport Accept-Encoding: gzip not prompting encoded response

Ordering of multiple values in content-encoding header in http request

HTTP response throw error gzip: invalid header

GZip encoding in Jersey

Decode content-encoding gzip using Spring WebClient

Google cloud storage console Content-Encoding to gzip

GZip a string for output from Coldfusion results in "Content Encoding Error" in browsers

InvalidParameterValue: Duplicate header 'Content-Transfer-Encoding'

Content-Encoding header not returned from Cloudfront

Is Content-Transfer-Encoding an HTML header?

Jersey/JAX-RS : Return Content-Length in response header instead of chunked transfer encoding

No gzip compression in response header using angular 4, litespeed cpanel