[QuickLook] Use case-insensitive comparison of preview MIME types
[WebKit-https.git] / Source / WebCore / ChangeLog
index 9b54ce1716f206c400702c2eeb0c7d55ebcd48b4..88fa46ebe7bb1d63672f32aa86eff085ad692378 100644 (file)
@@ -1,3 +1,25 @@
+2017-08-09  Andy Estes  <aestes@apple.com>
+
+        [QuickLook] Use case-insensitive comparison of preview MIME types
+        https://bugs.webkit.org/show_bug.cgi?id=175350
+        <rdar://problem/33761159>
+
+        Reviewed by Brady Eidson.
+
+        MIME types are case-insensitive, but PreviewLoader was using a case-sensitive comparison to
+        determine if a MIME type was supported by QLPreviewConverter. As a result we would fail to
+        preview Excel macro-enabled workbooks, since CFNetwork would sniff a MIME type of
+        "application/vnd.ms-excel.sheet.macroEnabled.12" but QuickLook contained
+        "application/vnd.ms-excel.sheet.macroenabled.12" in its set of supported MIME type strings.
+
+        Fix this by copying the QuickLook supported MIME type set into a HashSet using
+        ASCIICaseInsensitiveHash and using that HashSet for MIME type checks.
+
+        Test: quicklook/excel-macro-enabled.html
+
+        * loader/ios/PreviewLoader.mm:
+        (WebCore::PreviewLoader::shouldCreateForMIMEType):
+
 2017-08-09  Ms2ger  <Ms2ger@igalia.com>
 
         Remove unnecessary copies of PlatformMediaSessionManager::m_sessions