By default Alamofire is sending an Accept-Encoding header that includes gzip. How do I tell it to stop doing that? I do accept gzip, and I'm glad to have Alamofire parse it out for me, but when you send that header, ngix immediately removes the Content-Length header (ARGH!!!!) and that breaks things for me.
I found that alamofire adds the following headers:
Accept-Language: en;q=1.0
Accept-Encoding: gzip;q=1.0, compress;q=0.5
the q= part was the problematic part and what caused my server to return an error.
To solve it i added my own Accept-Language and Accept-Encoding headers to override the default headers. mine were without the q= part.
headers["Accept-Language"] = "en"
headers["Accept-Encoding"] = "gzip"
That did the trick, hope it will be of help to someone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With