Changeset 276986 in webkit
- Timestamp:
- May 4, 2021 3:37:08 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/files/blob-with-charget-as-main-resource-expected.html (added)
-
LayoutTests/fast/files/blob-with-charget-as-main-resource.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/network/BlobResourceHandle.cpp (modified) (1 diff)
-
Source/WebCore/platform/network/HTTPParsers.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r276984 r276986 1 2021-05-04 Chris Dumez <cdumez@apple.com> 2 3 Blob contentType with charset renders html as plain text 4 https://bugs.webkit.org/show_bug.cgi?id=225226 5 6 Reviewed by Alex Christensen. 7 8 Add layout test coverage. 9 10 * fast/files/blob-with-charget-as-main-resource-expected.html: Added. 11 * fast/files/blob-with-charget-as-main-resource.html: Added. 12 1 13 2021-05-04 Cameron McCormack <heycam@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r276984 r276986 1 2021-05-04 Chris Dumez <cdumez@apple.com> 2 3 Blob contentType with charset renders html as plain text 4 https://bugs.webkit.org/show_bug.cgi?id=225226 5 6 Reviewed by Alex Christensen. 7 8 Our code would use the Blob's Content-Type (media type) as a MIME type internally. As a result, if the Blob's 9 media type would contain anything besides the MIME type (e.g. a charget), then it would lead to failures. 10 11 Test: fast/files/blob-with-charget-as-main-resource.html 12 13 * platform/network/BlobResourceHandle.cpp: 14 (WebCore::BlobResourceHandle::notifyResponseOnSuccess): 15 * platform/network/HTTPParsers.h: 16 1 17 2021-05-04 Cameron McCormack <heycam@apple.com> 2 18 -
trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp
r266611 r276986 570 570 571 571 bool isRangeRequest = m_rangeOffset != kPositionNotSpecified; 572 ResourceResponse response(firstRequest().url(), m_blobData->contentType(), m_totalRemainingSize, String());572 ResourceResponse response(firstRequest().url(), extractMIMETypeFromMediaType(m_blobData->contentType()), m_totalRemainingSize, String()); 573 573 response.setHTTPStatusCode(isRangeRequest ? httpPartialContent : httpOK); 574 574 response.setHTTPStatusText(isRangeRequest ? httpPartialContentText : httpOKText); -
trunk/Source/WebCore/platform/network/HTTPParsers.h
r266087 r276986 80 80 Optional<WallTime> parseHTTPDate(const String&); 81 81 String filenameFromHTTPContentDisposition(const String&); 82 String extractMIMETypeFromMediaType(const String&);82 WEBCORE_EXPORT String extractMIMETypeFromMediaType(const String&); 83 83 String extractCharsetFromMediaType(const String&); 84 84 XSSProtectionDisposition parseXSSProtectionHeader(const String& header, String& failureReason, unsigned& failurePosition, String& reportURL); -
trunk/Source/WebKit/ChangeLog
r276983 r276986 1 2021-05-04 Chris Dumez <cdumez@apple.com> 2 3 Blob contentType with charset renders html as plain text 4 https://bugs.webkit.org/show_bug.cgi?id=225226 5 6 Reviewed by Alex Christensen. 7 8 Our code would use the Blob's Content-Type (media type) as a MIME type internally. As a result, if the Blob's 9 media type would contain anything besides the MIME type (e.g. a charget), then it would lead to failures. 10 11 * NetworkProcess/NetworkDataTaskBlob.cpp: 12 (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): 13 1 14 2021-05-04 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp
r270638 r276986 256 256 257 257 Ref<NetworkDataTaskBlob> protectedThis(*this); 258 ResourceResponse response(m_firstRequest.url(), errorCode != Error::NoError ? "text/plain" : m_blobData->contentType(), errorCode != Error::NoError ? 0 : m_totalRemainingSize, String());258 ResourceResponse response(m_firstRequest.url(), errorCode != Error::NoError ? "text/plain" : extractMIMETypeFromMediaType(m_blobData->contentType()), errorCode != Error::NoError ? 0 : m_totalRemainingSize, String()); 259 259 switch (errorCode) { 260 260 case Error::NoError: {
Note: See TracChangeset
for help on using the changeset viewer.