Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

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)

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

See http://stackapps.com/questions/725/supported-platforms

gzip is being enforced with predjudice.

share|improve this answer
3  
Then the server should send a 406 response. –  Artefacto Jun 15 '10 at 11:09
add comment

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.

share|improve this answer
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 Jun 15 '10 at 11:17
    
@Artefacto - ... why? We already deviate from the spec to work around real world issues, why throw more error conditions out there? –  Kevin Montrose Jun 15 '10 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 Jun 15 '10 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. –  Kevin Montrose Jun 15 '10 at 12:30
add comment

You must log in to answer this question.

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