WebKit Bugzilla
Attachment 350198 Details for
Bug 169276
: Align XMLHttpRequest's overrideMimeType() with the standard
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-169276-20180920160357.patch (text/plain), 3.26 KB, created by
Rob Buis
on 2018-09-20 07:03:58 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-09-20 07:03:58 PDT
Size:
3.26 KB
patch
obsolete
>Subversion Revision: 236165 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 9fcb657142ed7fe2503cc27f7bdae634efdf21e4..f95ef70573dbadea56add14ad77e3e1066dcd6c3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,16 @@ >+2018-09-20 Rob Buis <rbuis@igalia.com> >+ >+ Align XMLHttpRequest's overrideMimeType() with the standard >+ https://bugs.webkit.org/show_bug.cgi?id=169276 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/network/ParsedContentType.cpp: >+ (WebCore::parseContentType): >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::overrideMimeType): >+ >+ > 2018-09-19 Philippe Normand <pnormand@igalia.com> > > [GStreamer] Add support for AV1 decoding >diff --git a/Source/WebCore/platform/network/ParsedContentType.cpp b/Source/WebCore/platform/network/ParsedContentType.cpp >index 2d553f874625ca82971abf8766a0a8c52ed9fb0c..8b78297714da11e470ff1abd5663bcfc0732f4d4 100644 >--- a/Source/WebCore/platform/network/ParsedContentType.cpp >+++ b/Source/WebCore/platform/network/ParsedContentType.cpp >@@ -160,14 +160,32 @@ bool parseContentType(const String& contentType, ReceiverType& receiver) > return false; > } > >+ unsigned contentTypeStart = index; >+ auto typeRange = parseToken(contentType, index); >+ if (!typeRange.second) { >+ LOG_ERROR("Invalid Content-Type, invalid type value."); >+ return false; >+ } >+ >+ if (contentType[index++] != '/') { >+ LOG_ERROR("Invalid Content-Type, missing '/'."); >+ return false; >+ } >+ >+ auto subTypeRange = parseToken(contentType, index); >+ if (!subTypeRange.second) { >+ LOG_ERROR("Invalid Content-Type, invalid subtype value."); >+ return false; >+ } >+ > // There should not be any quoted strings until we reach the parameters. >- size_t semiColonIndex = contentType.find(';', index); >+ size_t semiColonIndex = contentType.find(';', contentTypeStart); > if (semiColonIndex == notFound) { >- receiver.setContentType(SubstringRange(index, contentTypeLength - index)); >+ receiver.setContentType(SubstringRange(contentTypeStart, contentTypeLength - contentTypeStart)); > return true; > } > >- receiver.setContentType(SubstringRange(index, semiColonIndex - index)); >+ receiver.setContentType(SubstringRange(contentTypeStart, semiColonIndex - contentTypeStart)); > index = semiColonIndex + 1; > while (true) { > skipSpaces(contentType, index); >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index 631ba78b74cc4a8bf3dfa9ba81de98317c4621f9..629f5a487de0a0b16e8dc05f726c6d968e677cd6 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -776,12 +776,15 @@ void XMLHttpRequest::dropProtection() > unsetPendingActivity(this); > } > >-ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& override) >+ExceptionOr<void> XMLHttpRequest::overrideMimeType(const String& mimeType) > { > if (readyState() == LOADING || readyState() == DONE) > return Exception { InvalidStateError }; > >- m_mimeTypeOverride = override; >+ m_mimeTypeOverride = "application/octet-stream"; >+ if (isValidContentType(mimeType)) >+ m_mimeTypeOverride = mimeType; >+ > return { }; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 169276
:
350188
|
350198
|
350199
|
350201
|
350205
|
350210
|
350251
|
350741