2

Either today or yesterday, besides /questions/tagged having disappeared, the server started ignoring the Accept-encoding header:

Ligação estabelecida com 69.59.196.211 na porta 80
GET /0.8/questions/?tagged=C HTTP/1.0
Host: api.stackoverflow.com
Accept-encoding: none
 
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 15 Jun 2010 10:42:20 GMT
Content-Type: application/json; charset=utf-8
Connection: close
Cache-Control: private
Content-Encoding: gzip
X-AspNetMvc-Version: 2.0
X-RateLimit-Max: 10000
X-RateLimit-Current: 9992
X-AspNet-Version: 2.0.50727
Content-Length: 5302

(content follows)

If gzip encoding is being enforced, the server should send a 406 response:

If an Accept-Encoding field is present in a request, and if the server cannot send a response which is acceptable according to the Accept-Encoding header, then the server SHOULD send an error response with the 406 (Not Acceptable) status code. (RFC 2616, section 14.3)

2 Answers 2

2

See Supported Platforms

gzip is being enforced with predjudice.

1
  • 4
    Then the server should send a 406 response.
    – Artefacto
    Commented Jun 15, 2010 at 11:09
1

A 406 response breaks* a ton of proxies. In effect, if we strictly follow the standard we prevent many people on corporate networks from accessing the API.

We found this out the hard way.

*Technically these proxies strip out Accept-Encoding causing a 406 to always occur.

4
  • 1
    I'm not following. If the proxies strip the Accept-Encoding header, then by all means send the gziped response. But if an Accept-encoding: none header reaches you, send a 406. No Accept-Encoding header <> Accept-encoding: none. In particular, RFC 2616 says "If no Accept-Encoding field is present in a request, the server MAY assume that the client will accept any content coding."
    – Artefacto
    Commented Jun 15, 2010 at 11:17
  • @Artefacto - ... why? We already deviate from the spec to work around real world issues, why throw more error conditions out there? Commented Jun 15, 2010 at 11:21
  • 1
    I'm specifically saying I do not accept any encoding, yet you refuse. Don't you think an error is due? The RFC says it should be, and apparently there are no "real world issues" in this particular case. I think these are enough reasons.
    – Artefacto
    Commented Jun 15, 2010 at 11:40
  • @Artefacto - you're ignoring the case where a proxy inserts an Accept-Encoding other than the one the client initially sent. This does happen, though somewhat less frequently than simply stripping it out. Commented Jun 15, 2010 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .