Title: [251769] trunk/Source/WebKit
Revision
251769
Author
carlo...@webkit.org
Date
2019-10-30 00:57:04 -0700 (Wed, 30 Oct 2019)

Log Message

REGRESSION(2.27.2): [GTK] Overview item remove button broken
https://bugs.webkit.org/show_bug.cgi?id=203461

Reviewed by Adrian Perez de Castro.

This is a regression of the switch to new custom protocols implementation. Epiphany is passing NULL as content
type of ephy-resource requests, in which case we should try to guess the mime type, but we are not doing it.

* UIProcess/API/glib/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback): Use MIMETypeRegistry to guess the mime type when content type is nullptr,
like NetworkDataTask does.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (251768 => 251769)


--- trunk/Source/WebKit/ChangeLog	2019-10-30 05:12:28 UTC (rev 251768)
+++ trunk/Source/WebKit/ChangeLog	2019-10-30 07:57:04 UTC (rev 251769)
@@ -1,3 +1,17 @@
+2019-10-30  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        REGRESSION(2.27.2): [GTK] Overview item remove button broken
+        https://bugs.webkit.org/show_bug.cgi?id=203461
+
+        Reviewed by Adrian Perez de Castro.
+
+        This is a regression of the switch to new custom protocols implementation. Epiphany is passing NULL as content
+        type of ephy-resource requests, in which case we should try to guess the mime type, but we are not doing it.
+
+        * UIProcess/API/glib/WebKitURISchemeRequest.cpp:
+        (webkitURISchemeRequestReadCallback): Use MIMETypeRegistry to guess the mime type when content type is nullptr,
+        like NetworkDataTask does.
+
 2019-10-29  Andy Estes  <aes...@apple.com>
 
         [Quick Look] Clean up LegacyPreviewLoaderClients

Modified: trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp (251768 => 251769)


--- trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp	2019-10-30 05:12:28 UTC (rev 251768)
+++ trunk/Source/WebKit/UIProcess/API/glib/WebKitURISchemeRequest.cpp	2019-10-30 07:57:04 UTC (rev 251769)
@@ -28,6 +28,7 @@
 #include "WebPageProxy.h"
 #include <WebCore/GUniquePtrSoup.h>
 #include <WebCore/HTTPParsers.h>
+#include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/ResourceError.h>
 #include <WebCore/URLSoup.h>
 #include <libsoup/soup.h>
@@ -181,6 +182,8 @@
     if (!priv->bytesRead) {
         ResourceResponse response(priv->task->request().url(), extractMIMETypeFromMediaType(priv->contentType.data()), priv->streamLength, emptyString());
         response.setTextEncodingName(extractCharsetFromMediaType(priv->contentType.data()));
+        if (response.mimeType().isEmpty())
+            response.setMimeType(MIMETypeRegistry::getMIMETypeForPath(response.url().path()));
         priv->task->didReceiveResponse(response);
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to