Re: Does NSURLConnection automatically decode gzip'd data?
Re: Does NSURLConnection automatically decode gzip'd data?
- Subject: Re: Does NSURLConnection automatically decode gzip'd data?
- From: Nicko van Someren <email@hidden>
- Date: Sat, 18 Jun 2005 23:45:31 +0100
On 18 Jun 2005, at 2:14, Steve Palmer wrote:
Can somebody please confirm something for me?
I'm using NSURLConnection under Mac OSX 10.4.1 to asynchronously
grab data from an HTTP source and I'm sending Accept-Encoding: gzip
in the header. Upon inspecting the HTTP data being returned, I'm
seeing Content-Encoding: gzip - all good and expected. However the
data that is being returned to didReceiveData is actually
uncompressed.
Well, I don't know about this with NSURLConnection but they have not
yet (10.4.1) fixed this with NSData initWithContentsOfURL:. With
that method the server is automatically sent the header line:
Accept-Encoding: gzip, deflate;q=1.0, identity;q=0.5, *;q=0
but if the server responds by using gzip in for the transport the
class does NOT decompress the data upon arrival. There does not
appear to be any way to ask the system to not request transport
compression and there is no way to tell if the data got compressed in
transit or not; you just sometimes get compressed data that you were
not expecting and you have no way to know if was that way on at rest
on the server or if it was squeezed as an artefact of the
transmission. I filed a bug report on this some time ago (ID
4049855) and I would have thought that if they had added gzip
decoding in NSURLConnection then at least they would have fixed this
bug :-(
Nicko
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden