Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Erdfelt2013-10-07 23:45:21 +0000
committerJoakim Erdfelt2013-10-07 23:45:21 +0000
commit180d9a55df6d7b023769224f13f304244e6e2687 (patch)
treece654d638f5acb4b78bbbf0e6eab6bdfbd61f880 /jetty-websocket/websocket-api/src
parent7cb553557efcf08bc6d487aa15e051bdbd67610b (diff)
downloadorg.eclipse.jetty.project-180d9a55df6d7b023769224f13f304244e6e2687.tar.gz
org.eclipse.jetty.project-180d9a55df6d7b023769224f13f304244e6e2687.tar.xz
org.eclipse.jetty.project-180d9a55df6d7b023769224f13f304244e6e2687.zip
418792 - Session getProtocolVersion always returns null
+ Backporting just the getProtocolVersion from jetty 9.1
Diffstat (limited to 'jetty-websocket/websocket-api/src')
-rw-r--r--jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java10
-rw-r--r--jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java2
2 files changed, 11 insertions, 1 deletions
diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java
index e805f8614b..28405122f8 100644
--- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java
+++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeRequest.java
@@ -181,6 +181,16 @@ public class UpgradeRequest
{
return Collections.unmodifiableMap(parameters);
}
+
+ public String getProtocolVersion()
+ {
+ String version = getHeader("Sec-WebSocket-Version");
+ if (version == null)
+ {
+ return "13"; // Default
+ }
+ return version;
+ }
public String getQueryString()
{
diff --git a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java
index 51a04c0049..cf4424af0f 100644
--- a/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java
+++ b/jetty-websocket/websocket-api/src/main/java/org/eclipse/jetty/websocket/api/UpgradeResponse.java
@@ -163,7 +163,7 @@ public class UpgradeResponse
/**
* Set the list of extensions that are approved for use with this websocket.
* <p>
- * This is Advanced usage of the {@link WebSocketCreator} to allow for a custom set of negotiated extensions.
+ * This is Advanced usage of the WebSocketCreator to allow for a custom set of negotiated extensions.
* <p>
* Notes:
* <ul>

Back to the top