418792 - Session getProtocolVersion always returns null
+ Backporting just the getProtocolVersion from jetty 9.1
This commit is contained in:
parent
7cb553557e
commit
180d9a55df
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -361,8 +361,6 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Inc
|
|||
|
||||
/**
|
||||
* Open/Activate the session
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
public void open()
|
||||
{
|
||||
|
@ -423,6 +421,7 @@ public class WebSocketSession extends ContainerLifeCycle implements Session, Inc
|
|||
public void setUpgradeRequest(UpgradeRequest request)
|
||||
{
|
||||
this.upgradeRequest = request;
|
||||
this.protocolVersion = request.getProtocolVersion();
|
||||
}
|
||||
|
||||
public void setUpgradeResponse(UpgradeResponse response)
|
||||
|
|
Loading…
Reference in New Issue