danielcrenna/hammock — Issue #47: Http GZip deserialization issue for Windows Phone
Author: farcasclaudiu
Created: 2011-10-21 08:29:36+00:00
State: open

I tested the GZip compression/decompression for Windows Phone and it seems not to work.
After investigating the issue I found that in file
src\net35\Hammock.Silverlight\Compat\GzipHttpWebResponse.cs
line 60

...
#if !WindowsPhone
...
#else
byte[] marker;
responseStream = ReadIntoMemoryStream(responseStream, out marker);
if (marker.Length > 2 && (marker[0] == 31 && marker[1] == 139))
{
compressed = new GZipInputStream(responseStream);
}
#endif

to fix the issue ..
replace
if (marker.Length > 2 && (marker[0] == 31 && marker[1] == 139))
with
if (marker.Length > 1 && (marker[0] == 31 && marker[1] == 139))

Regards,