0

I need to disable compression for atmosphere request headers. so instead of: Accept-Encoding: gzip, deflate

I want to change this to: Accept-Encoding: identity

Here's the headers from the request atmosphere.js creates:

Accept  text/event-stream
Accept-Encoding gzip, deflate
Accept-Language en-US,en;q=0.5
Cache-Control   no-cache
Connection  keep-alive
Cookie  JSESSIONID=791714A6221EEBBA
DNT 1
Host    host
Pragma  no-cache
Referer http://page url
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0

I found in atmosphere documentation that you can specify headers: headers [default = {}] A list of headers to send

But if I use this option: headers={'Accept-Encoding':'identity'}

that gets passed as a request parameter- NOT a header. Heres the request parameters that atmosphere.js creates:

Accept-Encoding identity
 Content-Type   application/json
 X-Atmosphere-Framework 2.1.2-jquery
 X-Atmosphere-Transport sse
 X-Atmosphere-tracking-id   3a8f82b4-bbd9-48d8-907a-6e54ac94cbd6
 X-Cache-Date   0
 X-atmo-protocol    true

Any ideas on how I can get Atmosphere to create requests without compression?

Rachel
  • 3
  • 2

1 Answers1

1

Just set request.attachHeadersAsQueryString = false

halfer
  • 19,824
  • 17
  • 99
  • 186
jfarcand
  • 1,705
  • 9
  • 6
  • Thanks for the suggestion but alas, no dice! I've tried: request.attachHeadersAsQueryString = false as well as request.attachHeadersAsQueryString="false" and request = {url:"sdfsd",..., attachHeaderAsQueryString: false} and the last as a string as well... but I'l still getting the request header accept-endcoding as gzip, deflate. Is there another way I can try to disable compression? This is happening on Firefox- could firefox be doing this? – Rachel Sep 10 '14 at 15:15
  • UGH it is firefox adding the gzip, deflate. I was able to turn this behavior off by modifying Firefox configs: http://forgetmenotes.blogspot.com/2009/05/how-to-disable-gzip-compression-in.html jfarcand's solution works if the FF config isn't an issue – Rachel Sep 10 '14 at 19:20