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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13777</bug_id>
          
          <creation_ts>2011-08-15 08:27:06 +0000</creation_ts>
          <short_desc>The WebSocket protocol draft (hybi-10) restricts the value of subprotocols as follows:     The elements that comprise this value MUST be non-     empty strings with characters in the range U+0021 to U+007E not     including separator characters as defined</short_desc>
          <delta_ts>2011-09-19 22:34:13 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>WebSocket API (editor: Ian Hickson)</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#top</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>art.barstow</cc>
    
    <cc>brian.raymor</cc>
    
    <cc>ian</cc>
    
    <cc>jonas</cc>
    
    <cc>julian.reschke</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55056</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-15 08:27:06 +0000</bug_when>
    <thetext>Specification: http://dev.w3.org/html5/websockets/
Multipage: http://www.whatwg.org/C#top
Complete: http://www.whatwg.org/c#top

Comment:
The WebSocket protocol draft (hybi-10) restricts the value of subprotocols as
follows:

    The elements that comprise this value MUST be non-
    empty strings with characters in the range U+0021 to U+007E not
    including separator characters as defined in [RFC2616], and MUST
    all be unique strings.&quot;

Current WebSocket API does not fully enforce the above limitations. I think
API should be in line with the protocol spec on limitation of subprotocols.

This affects the following snippets of text from WS API:

&quot;The subprotocol names must all be non-empty ASCII strings with no control
characters and no spaces in them (i.e. only characters in the range U+0021 to
U+007E).&quot;

This statement should mention:
- Subprotocol names must not contain separator characters.
- Each subprotocol name must be unique.

&quot;If any of the values in protocols occur more than once or contain characters
with Unicode code points less than U+0021 or greater than U+007E (i.e. the
space character or any characters that are not printable ASCII characters),
then throw a SYNTAX_ERR exception and abort these steps.&quot;

This statement should mention:
- Any of subprotocol names must not be empty.
- Subprotocol names must not contain separator characters.
- SYNTAX_ERR must be thrown in these cases.

Posted from: 2401:fa00:4:1000:baac:6fff:fe99:adfb
User agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/15.0.849.0 Safari/535.1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56022</commentid>
    <comment_count>1</comment_count>
    <who name="Brian Raymor [MSFT]">brian.raymor</who>
    <bug_when>2011-08-30 03:46:05 +0000</bug_when>
    <thetext>
I agree with this approach. It aligns subprotocol validation in the W3C API with the IETF draft which is fine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56574</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-09 22:13:14 +0000</bug_when>
    <thetext>What are the limitations in the protocol for?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56577</commentid>
    <comment_count>3</comment_count>
    <who name="Jonas Sicking (Not reading bugmail)">jonas</who>
    <bug_when>2011-09-10 01:20:03 +0000</bug_when>
    <thetext>I agree with comment 0. First off the protocol is what it is and unless changed we simply can&apos;t honor a protocol request outside the character range. So we&apos;ll provide better debugging information by throwing.

Second, allowing non-ascii characters here increases the risk of security problems if for example servers drop the high-byte in a decoded protocol. This is something that is happening in URLs today for example.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56585</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-10 04:23:46 +0000</bug_when>
    <thetext>There&apos;s no question the API has to only pass valid values to the API, I&apos;m just curious what the reasoning was in disallowing more than just non-ASCII.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56774</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-14 18:17:03 +0000</bug_when>
    <thetext>BTW, what are the &quot;separator characters as defined in [RFC2616]&quot;? Does it mean this &lt;separators&gt; terminal in the ABNF?

       separators     = &quot;(&quot; | &quot;)&quot; | &quot;&lt;&quot; | &quot;&gt;&quot; | &quot;@&quot;
                      | &quot;,&quot; | &quot;;&quot; | &quot;:&quot; | &quot;\&quot; | &lt;&quot;&gt;
                      | &quot;/&quot; | &quot;[&quot; | &quot;]&quot; | &quot;?&quot; | &quot;=&quot;
                      | &quot;{&quot; | &quot;}&quot; | SP | HT</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56775</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-14 18:17:38 +0000</bug_when>
    <thetext>(if so, that makes it illegal to use a URL as an extension token; is that really intentional?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57006</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-09-19 22:33:53 +0000</bug_when>
    <thetext>I just referenced the WebSocket protocol.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>57007</commentid>
    <comment_count>8</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-09-19 22:34:13 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r6555.
Check-in comment: Align with WSP on the subprotocol syntax.
http://html5.org/tools/web-apps-tracker?from=6554&amp;to=6555</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>