Title: [224645] trunk/Source/WebCore
Revision
224645
Author
[email protected]
Date
2017-11-09 13:09:24 -0800 (Thu, 09 Nov 2017)

Log Message

FetchResponse should set the mime type of its internal ResourceResponse
https://bugs.webkit.org/show_bug.cgi?id=179487

Patch by Youenn Fablet <[email protected]> on 2017-11-09
Reviewed by Chris Dumez.

No observable change.
Setting the mime type of the response as navigation loads use that field.
This will be used for navigation loads served by service worker.

* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (224644 => 224645)


--- trunk/Source/WebCore/ChangeLog	2017-11-09 20:58:15 UTC (rev 224644)
+++ trunk/Source/WebCore/ChangeLog	2017-11-09 21:09:24 UTC (rev 224645)
@@ -1,5 +1,19 @@
 2017-11-09  Youenn Fablet  <[email protected]>
 
+        FetchResponse should set the mime type of its internal ResourceResponse
+        https://bugs.webkit.org/show_bug.cgi?id=179487
+
+        Reviewed by Chris Dumez.
+
+        No observable change.
+        Setting the mime type of the response as navigation loads use that field.
+        This will be used for navigation loads served by service worker.
+
+        * Modules/fetch/FetchResponse.cpp:
+        (WebCore::FetchResponse::create):
+
+2017-11-09  Youenn Fablet  <[email protected]>
+
         ServiceWorker ResourceResponse should not assert in platformCertificateInfo()
         https://bugs.webkit.org/show_bug.cgi?id=179486
 

Modified: trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp (224644 => 224645)


--- trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp	2017-11-09 20:58:15 UTC (rev 224644)
+++ trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp	2017-11-09 21:09:24 UTC (rev 224645)
@@ -32,6 +32,7 @@
 #include "FetchRequest.h"
 #include "HTTPParsers.h"
 #include "JSBlob.h"
+#include "MIMETypeRegistry.h"
 #include "ResourceError.h"
 #include "ScriptExecutionContext.h"
 
@@ -111,6 +112,9 @@
     auto r = adoptRef(*new FetchResponse(context, WTFMove(extractedBody), WTFMove(headers), { }));
 
     r->m_contentType = contentType;
+    auto mimeType = extractMIMETypeFromMediaType(contentType);
+    r->m_response.setMimeType(mimeType.isEmpty() ? defaultMIMEType() : mimeType);
+
     r->m_response.setHTTPStatusCode(status);
     r->m_response.setHTTPStatusText(statusText);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to