tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1669430 - /tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
Date Thu, 26 Mar 2015 20:38:29 GMT
Author: markt
Date: Thu Mar 26 20:38:29 2015
New Revision: 1669430

URL: http://svn.apache.org/r1669430
Log:
Cleanup/simplify

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java?rev=1669430&r1=1669429&r2=1669430&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/WsWebSocketContainer.java Thu Mar 26 20:38:29
2015
@@ -499,15 +499,16 @@ public class WsWebSocketContainer implem
     }
 
 
-    private ByteBuffer createRequest(URI uri,
-            Map<String,List<String>> reqHeaders) {
+    private ByteBuffer createRequest(URI uri, Map<String,List<String>> reqHeaders)
{
         ByteBuffer result = ByteBuffer.allocate(4 * 1024);
 
         // Request line
         result.put(GET_BYTES);
-        byte[] path = (null == uri.getPath() || "".equals(uri.getPath()))
-                ? ROOT_URI_BYTES : uri.getRawPath().getBytes(StandardCharsets.ISO_8859_1);
-        result.put(path);
+        if (null == uri.getPath() || "".equals(uri.getPath())) {
+            result.put(ROOT_URI_BYTES);
+        } else {
+            result.put(uri.getRawPath().getBytes(StandardCharsets.ISO_8859_1));
+        }
         String query = uri.getRawQuery();
         if (query != null) {
             result.put((byte) '?');
@@ -516,8 +517,7 @@ public class WsWebSocketContainer implem
         result.put(HTTP_VERSION_BYTES);
 
         // Headers
-        Iterator<Entry<String,List<String>>> iter =
-                reqHeaders.entrySet().iterator();
+        Iterator<Entry<String,List<String>>> iter = reqHeaders.entrySet().iterator();
         while (iter.hasNext()) {
             Entry<String,List<String>> entry = iter.next();
             addHeader(result, entry.getKey(), entry.getValue());



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


Mime
View raw message