Issue #207 - allowing untrusted sessions to have non-validating generators
This commit is contained in:
parent
36f40689cc
commit
1d18522a99
|
@ -62,8 +62,9 @@ public class Generator
|
|||
|
||||
private final WebSocketBehavior behavior;
|
||||
private final ByteBufferPool bufferPool;
|
||||
private final boolean validating;
|
||||
private final boolean readOnly;
|
||||
|
||||
private boolean validating = true;
|
||||
|
||||
/**
|
||||
* Are any flags in use
|
||||
|
@ -374,7 +375,12 @@ public class Generator
|
|||
{
|
||||
return bufferPool;
|
||||
}
|
||||
|
||||
|
||||
public boolean isValidating()
|
||||
{
|
||||
return validating;
|
||||
}
|
||||
|
||||
public void setRsv1InUse(boolean rsv1InUse)
|
||||
{
|
||||
if (readOnly)
|
||||
|
@ -401,7 +407,12 @@ public class Generator
|
|||
}
|
||||
flagsInUse = (byte)((flagsInUse & 0xEF) | (rsv3InUse?0x10:0x00));
|
||||
}
|
||||
|
||||
|
||||
public void setValidating(boolean validating)
|
||||
{
|
||||
this.validating = validating;
|
||||
}
|
||||
|
||||
public boolean isRsv1InUse()
|
||||
{
|
||||
return (flagsInUse & 0x40) != 0;
|
||||
|
|
|
@ -33,7 +33,9 @@ public class UntrustedWSSession extends WebSocketSession implements AutoCloseabl
|
|||
public UntrustedWSSession(WebSocketContainerScope containerScope, URI requestURI, Object endpoint, LogicalConnection connection)
|
||||
{
|
||||
super(containerScope, requestURI, endpoint, connection);
|
||||
this.untrustedConnection = new UntrustedWSConnection((AbstractWebSocketConnection) connection);
|
||||
AbstractWebSocketConnection abstractWebSocketConnection = (AbstractWebSocketConnection) connection;
|
||||
abstractWebSocketConnection.getGenerator().setValidating(false);
|
||||
this.untrustedConnection = new UntrustedWSConnection(abstractWebSocketConnection);
|
||||
this.untrustedEndpoint = (UntrustedWSEndpoint) endpoint;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue