From 0af86bbb9d63ffe4927bb2e75ec48dd8f54c21ce Mon Sep 17 00:00:00 2001 From: Andy Matuschak Date: Mon, 21 Jul 2008 20:55:04 -0700 Subject: [PATCH] Hopefully actually fixing 246469: it seems that while Cocoa documents its use of gzip as having the MIME type "application/gzip", it actually uses (what it's supposed to) "application/x-gzip". --- SUBasicUpdateDriver.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SUBasicUpdateDriver.m b/SUBasicUpdateDriver.m index 769358c9..21299159 100644 --- a/SUBasicUpdateDriver.m +++ b/SUBasicUpdateDriver.m @@ -163,8 +163,9 @@ - (BOOL)download:(NSURLDownload *)download shouldDecodeSourceDataOfMIMEType:(NSString *)encodingType { - if ([encodingType isEqualToString:@"application/gzip"]) return NO; - return YES; + // We don't want the download system to extract our gzips. + // Note that we use a substring matching here instead of direct comparison because the docs say "application/gzip" but the system *uses* "application/x-gzip". This is a documentation bug. + return ([encodingType rangeOfString:@"gzip"].origin == NSNotFound); } - (void)extractUpdate