[Webkit-unassigned] [Bug 226635] New: EventSource.constructor throws an exception when the url param is an empty string
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Jun 4 02:46:36 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=226635
Bug ID: 226635
Summary: EventSource.constructor throws an exception when the
url param is an empty string
Product: WebKit
Version: WebKit Local Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: WebKitGTK
Assignee: webkit-unassigned at lists.webkit.org
Reporter: zyscoder at gmail.com
CC: bugs-noreply at webkitgtk.org
Steps to reproduce:
(1) Open a tab and navigate to any URL;
(2) Run the following code in the Console of Devtools:
```
new EventSource("")
```
(3) Then this code would throw a SyntaxError exception.
Actual results:
This code would throw a SyntaxError exception: `SyntaxError: The string did not match the expected pattern.`
Expected results:
As https://html.spec.whatwg.org/multipage/server-sent-events.html#dom-eventsource says, when the URL param is an empty string, it should be parsed as a relative URL to the API's URL.
In fact, Firefox works as the spec says, and Chrome has fixed this problem following the spec nowadays too.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210604/35701c86/attachment-0001.htm>
More information about the webkit-unassigned
mailing list