1

I use a web application that's returning a Content-MD5 header but in my iOS app, I cannot retrieve that header using [NSHTTPURLResponse allHeaderFields] (whereas I can see it when I use cURL).

Does anyone know if iOS is deliberately removing that header?

g_fred
  • 5,878
  • 3
  • 28
  • 36

1 Answers1

0

So I've figured out what's happened.

Our SaaS provider has activated gzip by default on non-production instances. As mentioned in some other threads, NSURLConnection supports gzip compression transparently and will automatically send the Accept-Encoding: gzip HTTP header. When the response is received, NSURLConnection decompresses the content and removes the Content-Md5 header (because the Content-MD5 is a hash of the compressed data), which is why I'm not seeing it in the list of received headers.

Community
  • 1
  • 1
g_fred
  • 5,878
  • 3
  • 28
  • 36