OK, I now see the console message where jQuery refuses to set the unsafe header, so it looks like this behavior is expected. I am having trouble finding a good explanation of what is unsafe about it though. Is it that this header is unsafe when used in combination with some other header value (say, a particular MIME type or charset)? In other words, is there no way to change this?
On Jan 26, 2:41 pm, Andrew Hedges <segd...@gmail.com> wrote: > I'm trying to make an Ajax request, specifically requesting a non- > gzipped response. Here's how I am going about it: > > $.ajax({ > url : 'http://my.valid.url/', > method : 'get', > beforeSend : function (xhr) { > xhr.setRequestHeader('Accept-Encoding', 'identity'); > xhr.setRequestHeader('X-Test', 'foo'); > } > > }); > > Watching the action with LiveHTTPHeaders in Firefox 3, I can see that > "X-Test: foo" gets set correctly, but I'm still seeing "Accept- > Encoding: gzip,deflate". Is this expected behavior? If so, is there a > reason why I can't change the Accept-Encoding value? > > Thanks, > -Andrew