jshttp / accepts

Higher-level content negotiation
MIT License
252 stars 42 forks source link

Identity encoding isn't always acceptable #1

Closed federomero closed 10 years ago

federomero commented 10 years ago

The identity encoding could be specifically refused if Accept-Encoding includes "identity;q=0". Negotiator already handles this, you should rely on it instead of always assuming the identity encoding is acceptable.

jonathanong commented 10 years ago

oh shoot. you're right. http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3 i wonder when people would do q=0

i'll just add you as a collaborator and give you npm rights. just make sure the tests pass!

federomero commented 10 years ago

I really don't know why people would set identity;q=0, maybe if you are requesting a big amount of data and you just want it if they have it compressed? Still, seems like a very unusual case.

I just fixed the broken spec and merged the branch

jonathanong commented 10 years ago

yeah me neither. i gave you rights to npm. did you want to publish yourself?

jonathanong commented 10 years ago

there are sites like stackoverflow that always serve gzip regardless of accept-encoding. ~_~

federomero commented 10 years ago

Yeah I guess a lot of sites ignore most of the content negotiation.