[html5] r4400 - [giow] (0) Make the WebSocket() constructor throw for a bad protocol string.

whatwg at whatwg.org whatwg at whatwg.org
Thu Dec 3 16:28:40 PST 2009


Author: ianh
Date: 2009-12-03 16:28:38 -0800 (Thu, 03 Dec 2009)
New Revision: 4400

Modified:
   complete.html
   source
Log:
[giow] (0) Make the WebSocket() constructor throw for a bad protocol string.

Modified: complete.html
===================================================================
--- complete.html	2009-12-03 23:44:19 UTC (rev 4399)
+++ complete.html	2009-12-04 00:28:38 UTC (rev 4400)
@@ -110,7 +110,7 @@
 
   <header class=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <hgroup><h1>Web Applications 1.0</h1>
-    <h2 class="no-num no-toc">Draft Standard — 3 December 2009</h2>
+    <h2 class="no-num no-toc">Draft Standard — 4 December 2009</h2>
    </hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -65309,9 +65309,13 @@
   constructor takes one or two arguments. The first argument, <var title="">url</var>, specifies the <a href=#url>URL</a> to which to
   connect. The second, <var title="">protocol</var>, if present,
   specifies a sub-protocol that the server must support for the
-  connection to be successful. When the <code>WebSocket()</code>
-  constructor is invoked, the UA must run these steps:</p>
+  connection to be successful. The sub-protocol name must be an ASCII
+  string with no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
+  characters in it.</p>
 
+  <p>When the <code>WebSocket()</code> constructor is invoked, the UA
+  must run these steps:</p>
+
   <ol><!-- beware, this is very similar to the steps for what happens
    during a redirect, in the protocol section --><li><p><a href="#parse-a-web-socket-url's-components">Parse a Web Socket URL's components</a> from the
    <var title="">url</var> argument, to obtain <var title="">host</var>, <var title="">port</var>, <var title="">resource name</var>, and <var title="">secure</var>. If
@@ -65326,6 +65330,13 @@
     e.g. http://www.mozilla.org/projects/netlib/PortBanning.html
    -->
 
+   <li><p>If <var title="">protocol</var> is present but contains
+   characters with Unicode code points greater than U+007F (i.e. any
+   characters that are not ASCII characters), or if it contains either
+   a U+000A LINE FEED (LF) character or a U+000D CARRIAGE RETURN (CR)
+   character, then throw a <code><a href=#syntax_err>SYNTAX_ERR</a></code> exception and abort
+   these steps.</li>
+
    <li><p>Let <var title="">origin</var> be the <a href=#ascii-serialization-of-an-origin title="ASCII
    serialization of an origin">ASCII serialization</a> of the
    <a href=#origin>origin</a> of the script that invoked the <code title=dom-WebSocket><a href=#dom-websocket>WebSocket()</a></code> constructor,

Modified: source
===================================================================
--- source	2009-12-03 23:44:19 UTC (rev 4399)
+++ source	2009-12-04 00:28:38 UTC (rev 4400)
@@ -74467,9 +74467,13 @@
   title="">url</var>, specifies the <span>URL</span> to which to
   connect. The second, <var title="">protocol</var>, if present,
   specifies a sub-protocol that the server must support for the
-  connection to be successful. When the <code>WebSocket()</code>
-  constructor is invoked, the UA must run these steps:</p>
+  connection to be successful. The sub-protocol name must be an ASCII
+  string with no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR)
+  characters in it.</p>
 
+  <p>When the <code>WebSocket()</code> constructor is invoked, the UA
+  must run these steps:</p>
+
   <ol>
 
    <!-- beware, this is very similar to the steps for what happens
@@ -74490,6 +74494,13 @@
     e.g. http://www.mozilla.org/projects/netlib/PortBanning.html
    -->
 
+   <li><p>If <var title="">protocol</var> is present but contains
+   characters with Unicode code points greater than U+007F (i.e. any
+   characters that are not ASCII characters), or if it contains either
+   a U+000A LINE FEED (LF) character or a U+000D CARRIAGE RETURN (CR)
+   character, then throw a <code>SYNTAX_ERR</code> exception and abort
+   these steps.</p></li>
+
    <li><p>Let <var title="">origin</var> be the <span title="ASCII
    serialization of an origin">ASCII serialization</span> of the
    <span>origin</span> of the script that invoked the <code




More information about the Commit-Watchers mailing list