Author: markt
Date: Wed Jan 29 11:23:42 2014
New Revision: 1562411

URL: http://svn.apache.org/r1562411
Log:
Fix bug handling the Sec-WebSocket-Protocol header returned to the client

Modified:
    tomcat/trunk/build.properties.default
    tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
    tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1562411&r1=1562410&r2=1562411&view=diff
==============================================================================
--- tomcat/trunk/build.properties.default (original)
+++ tomcat/trunk/build.properties.default Wed Jan 29 11:23:42 2014
@@ -176,7 +176,7 @@ nsis.loc=${base-sf.loc}/nsis/nsis-2.46.z
 
 # ----- Commons Daemon, version 1.0-Alpha or later -----
 commons-daemon.version=1.0.15
-commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version}
+commons-daemon.home=${base.path}/commons-daemon-${commons-daemon.version}-test-signed
 
commons-daemon.jar=${commons-daemon.home}/commons-daemon-${commons-daemon.version}.jar
 commons-daemon.native.win.home=${commons-daemon.home}/windows
 commons-daemon.native.win.mgr.exe=${commons-daemon.native.win.home}/prunmgr.exe

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java?rev=1562411&r1=1562410&r2=1562411&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/server/UpgradeUtil.java Wed 
Jan 29 11:23:42 2014
@@ -128,7 +128,8 @@ public class UpgradeUtil {
                 Constants.CONNECTION_HEADER_VALUE);
         resp.setHeader(HandshakeResponse.SEC_WEBSOCKET_ACCEPT,
                 getWebSocketAccept(key));
-        if (subProtocol != null) {
+        if (subProtocol != null && subProtocol.length() > 0) {
+            // RFC6455 4.2.2 explicitly states "" is not valid here
             resp.setHeader("Sec-WebSocket-Protocol", subProtocol);
         }
         if (!extensions.isEmpty()) {

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1562411&r1=1562410&r2=1562411&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Wed Jan 29 11:23:42 2014
@@ -31,8 +31,8 @@
 <body>
 <!--
   Subsection ordering:
-  General, Catalina, Coyote, Jasper, Cluster, Web applications, Extras, Tribes,
-  Other
+  General, Catalina, Coyote, Jasper, Cluster, WebSocket, Web applications,
+  Extras, Tribes, Other
 
   Item Ordering:
 
@@ -43,11 +43,19 @@
   Other fixed issues are added to the end of the list, chronologically.
   They eventually become mixed with the numbered issues. (I.e., numbered
   issues to not "pop up" wrt. others).
-
-  Until the first Tomcat 8.0.0 release, only changes not back-ported to 7.0.x
-  should be listed here.
 -->
-<section name="Tomcat 8.0.0">
+<section name="Tomcat 8.0.1 (markt)">
+  <changelog>
+    <subsection name="WebSocket">
+      Do not return an empty string for the <code>Sec-WebSocket-Protocol</code>
+      HTTP header when no sub-protocol has been requested or no sub-protocol
+      could be agreed as RFC6455 requires that no
+      <code>Sec-WebSocket-Protocol</code> header is returned in this case.
+      (markt)
+    </subsection>
+  </changelog>
+</section>
+<section name="Tomcat 8.0.0 (markt)">
   <subsection name="Catalina">
     <changelog>
       <add>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to