<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>42636</bug_id>
          
          <creation_ts>2010-07-20 06:36:21 -0700</creation_ts>
          <short_desc>WebSocket() constructor should throw SYNTAX_ERR if URL has zero or one slash after &apos;ws:&apos; or &apos;wss:&apos;</short_desc>
          <delta_ts>2016-05-19 02:36:22 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Simon Pieters (:zcorpan)">zcorpan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>joenotcharles</cc>
    
    <cc>ukai</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>253689</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2010-07-20 06:36:21 -0700</bug_when>
    <thetext>WebKit implies the slashes if they&apos;re missing in WebSocket URLs.

new WebSocket(&apos;ws:example.org/&apos;);
new WebSocket(&apos;ws:/example.org/&apos;);

Apparently no slashes means no authority (user/pass+host+port), which doesn&apos;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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>253786</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-07-20 10:10:44 -0700</bug_when>
    <thetext>Mozilla folks seem to disagree that this is a bug, and I think they are right.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>315518</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-11-30 21:41:03 -0800</bug_when>
    <thetext>http://www.w3.org/Bugs/Public/show_bug.cgi?id=10213</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194621</commentid>
    <comment_count>3</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2016-05-18 21:26:46 -0700</bug_when>
    <thetext>Since Mozilla and Alexey think current behavior is correct, closing this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194708</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2016-05-19 02:35:02 -0700</bug_when>
    <thetext>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
&quot;Otherwise, if url is special, set state to special authority slashes state.&quot;
-&gt;
https://url.spec.whatwg.org/#special-authority-slashes-state
&quot;Otherwise, syntax violation, set state to special authority ignore slashes state, and decrease pointer by one.&quot;
-&gt;
https://url.spec.whatwg.org/#special-authority-ignore-slashes-state
&quot;If c is neither &quot;/&quot; nor &quot;\&quot;, set state to authority state, and decrease pointer by one.&quot;
-&gt;
https://url.spec.whatwg.org/#authority-state
&quot;Otherwise, append c to buffer.&quot;

...etc; it will parse successfully and up with the same URL record as for ws://example.org/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1194709</commentid>
    <comment_count>5</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2016-05-19 02:36:22 -0700</bug_when>
    <thetext>w-p-t test at 
http://w3c-test.org/websockets/constructor/017.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>