VERIFIED INVALID Bug 42636
WebSocket() constructor should throw SYNTAX_ERR if URL has zero or one slash after 'ws:' or 'wss:'
https://bugs.webkit.org/show_bug.cgi?id=42636
Summary WebSocket() constructor should throw SYNTAX_ERR if URL has zero or one slash ...
Simon Pieters (:zcorpan)
Reported 2010-07-20 06:36:21 PDT
WebKit implies the slashes if they're missing in WebSocket URLs. new WebSocket('ws:example.org/'); new WebSocket('ws:/example.org/'); Apparently no slashes means no authority (user/pass+host+port), which doesn't make sense for websocket, and websocket requires an absolute URL. So I think the above cases should throw SYNTAX_ERR. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=580234
Attachments
Alexey Proskuryakov
Comment 1 2010-07-20 10:10:44 PDT
Mozilla folks seem to disagree that this is a bug, and I think they are right.
Alexey Proskuryakov
Comment 2 2010-11-30 21:41:03 PST
Brent Fulgham
Comment 3 2016-05-18 21:26:46 PDT
Since Mozilla and Alexey think current behavior is correct, closing this.
Simon Pieters (:zcorpan)
Comment 4 2016-05-19 02:35:02 PDT
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17772#c5 e.g. for ws:example.org/ (no base url) https://url.spec.whatwg.org/#scheme-state "Otherwise, if url is special, set state to special authority slashes state." -> https://url.spec.whatwg.org/#special-authority-slashes-state "Otherwise, syntax violation, set state to special authority ignore slashes state, and decrease pointer by one." -> https://url.spec.whatwg.org/#special-authority-ignore-slashes-state "If c is neither "/" nor "\", set state to authority state, and decrease pointer by one." -> https://url.spec.whatwg.org/#authority-state "Otherwise, append c to buffer." ...etc; it will parse successfully and up with the same URL record as for ws://example.org/
Simon Pieters (:zcorpan)
Comment 5 2016-05-19 02:36:22 PDT
Note You need to log in before you can comment on or make changes to this bug.