WebKit Bugzilla
Attachment 349179 Details for
Bug 46008
: XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
attempt.diff (text/plain), 4.53 KB, created by
Rob Buis
on 2018-09-07 12:32:36 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2018-09-07 12:32:36 PDT
Size:
4.53 KB
patch
obsolete
>commit 9d671680372ff17422eb0a9bfc6cb8db5a46c6ae >Author: Rob Buis <rbuis@igalia.com> >Date: Fri Sep 7 21:06:33 2018 +0200 > > Yo > >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index 2eccbd80bdc..02df8287765 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,13 @@ >+2018-09-07 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved >+ https://bugs.webkit.org/show_bug.cgi?id=46008 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * web-platform-tests/xhr/open-url-bogus-expected.txt: >+ * web-platform-tests/xhr/open-url-multi-window-6-expected.txt: >+ > 2018-09-05 Youenn Fablet <youenn@apple.com> > > Expose RTCRtpSender.setParameters >diff --git a/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-bogus-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-bogus-expected.txt >index af528617df8..fd4e55b88cc 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-bogus-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-bogus-expected.txt >@@ -1,7 +1,7 @@ > >-FAIL XMLHttpRequest: open() - bogus URLs (//[) assert_throws: function "function () { client.open("GET", url) }" did not throw >+PASS XMLHttpRequest: open() - bogus URLs (//[) > FAIL XMLHttpRequest: open() - bogus URLs (ftp:) assert_throws: function "function () { client.open("GET", url) }" did not throw >-FAIL XMLHttpRequest: open() - bogus URLs (http://a a/) assert_throws: function "function () { client.open("GET", url) }" did not throw >-FAIL XMLHttpRequest: open() - bogus URLs (http:////////////) assert_throws: function "function () { client.open("GET", url) }" did not throw >-FAIL XMLHttpRequest: open() - bogus URLs (http://u:p@/) assert_throws: function "function () { client.open("GET", url) }" did not throw >+PASS XMLHttpRequest: open() - bogus URLs (http://a a/) >+PASS XMLHttpRequest: open() - bogus URLs (http:////////////) >+PASS XMLHttpRequest: open() - bogus URLs (http://u:p@/) > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-multi-window-6-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-multi-window-6-expected.txt >index f6a1ba979da..ac865369516 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-multi-window-6-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-multi-window-6-expected.txt >@@ -1,3 +1,3 @@ > >-FAIL XMLHttpRequest: open() in document that is not fully active (but may be active) should throw assert_throws: function "function () { client.open("GET", "...") }" did not throw >+FAIL XMLHttpRequest: open() in document that is not fully active (but may be active) should throw assert_throws: function "function () { client.open("GET", "...") }" threw object "SyntaxError: The string did not match the expected pattern." that is not a DOMException InvalidStateError: property "code" is equal to 12, expected 11 > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 79bb5925029..57b67c5c702 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-09-07 Rob Buis <rbuis@igalia.com> >+ >+ XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved >+ https://bugs.webkit.org/show_bug.cgi?id=46008 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Check if passed URL is valid as specified here [1]. >+ >+ Test: web-platform-tests/xhr/open-url-bogus.htm >+ >+ [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7 >+ >+ * xml/XMLHttpRequest.cpp: >+ (WebCore::XMLHttpRequest::open): >+ > 2018-09-05 Youenn Fablet <youenn@apple.com> > > Move ownership of outgoing source to RTCRtpSender backend >diff --git a/Source/WebCore/xml/XMLHttpRequest.cpp b/Source/WebCore/xml/XMLHttpRequest.cpp >index e895a3bc203..a9ab362ef69 100644 >--- a/Source/WebCore/xml/XMLHttpRequest.cpp >+++ b/Source/WebCore/xml/XMLHttpRequest.cpp >@@ -343,6 +343,9 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, boo > if (isForbiddenMethod(method)) > return Exception { SecurityError }; > >+ if (!url.isValid()) >+ return Exception { SyntaxError }; >+ > if (!async && scriptExecutionContext()->isDocument()) { > // Newer functionality is not available to synchronous requests in window contexts, as a spec-mandated > // attempt to discourage synchronous XHR use. responseType is one such piece of functionality.
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 46008
:
118359
| 349179