You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/07/07 13:48:17 UTC
[tomcat] branch master updated: support of schemes "wss" and "ws"
in WsHandshakeRequest.buildRequestUri() requests with scheme "wss" or "ws",
as outlined in [RFC 6455 section
11.1](https://tools.ietf.org/html/rfc6455#section-11.1),
will cause an `IllegalArgumentException` with message
"wsHandshakeRequest.unknownScheme"
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new da4f6bb support of schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri() requests with scheme "wss" or "ws", as outlined in [RFC 6455 section 11.1](https://tools.ietf.org/html/rfc6455#section-11.1), will cause an `IllegalArgumentException` with message "wsHandshakeRequest.unknownScheme"
da4f6bb is described below
commit da4f6bb1e570f8781b5cb27b2bce31f67316cbf6
Author: sephiroth-j <se...@sephiroth-j.de>
AuthorDate: Thu Jul 2 20:41:53 2020 +0200
support of schemes "wss" and "ws" in WsHandshakeRequest.buildRequestUri()
requests with scheme "wss" or "ws", as outlined in [RFC 6455 section 11.1](https://tools.ietf.org/html/rfc6455#section-11.1), will cause an `IllegalArgumentException` with message "wsHandshakeRequest.unknownScheme"
this fixes a regression from e09e6b04e41d3dae27fcfe060e6f8f89f1c0d6b5 / BZ 62731
---
java/org/apache/tomcat/websocket/server/WsHandshakeRequest.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/tomcat/websocket/server/WsHandshakeRequest.java b/java/org/apache/tomcat/websocket/server/WsHandshakeRequest.java
index 712a2e9..3fb0b11 100644
--- a/java/org/apache/tomcat/websocket/server/WsHandshakeRequest.java
+++ b/java/org/apache/tomcat/websocket/server/WsHandshakeRequest.java
@@ -156,6 +156,8 @@ public class WsHandshakeRequest implements HandshakeRequest {
uri.append("ws");
} else if ("https".equals(scheme)) {
uri.append("wss");
+ } else if ("wss".equals(scheme) || "ws".equals(scheme)) {
+ uri.append(scheme);
} else {
// Should never happen
throw new IllegalArgumentException(
@@ -166,6 +168,8 @@ public class WsHandshakeRequest implements HandshakeRequest {
uri.append(req.getServerName());
if ((scheme.equals("http") && (port != 80))
+ || (scheme.equals("ws") && (port != 80))
+ || (scheme.equals("wss") && (port != 443))
|| (scheme.equals("https") && (port != 443))) {
uri.append(':');
uri.append(port);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org