Fixing policy
This commit is contained in:
parent
2f3937687d
commit
f1be381866
|
@ -92,9 +92,9 @@ public class WebSocketPolicy
|
|||
public void assertValidPayloadLength(int payloadLength)
|
||||
{
|
||||
// validate to buffer sizes
|
||||
if (payloadLength > payloadLength)
|
||||
if (payloadLength > maxPayloadSize)
|
||||
{
|
||||
throw new MessageTooLargeException("Requested payload length [" + payloadLength + "] exceeds maximum size [" + payloadLength + "]");
|
||||
throw new MessageTooLargeException("Requested payload length [" + payloadLength + "] exceeds maximum size [" + maxPayloadSize + "]");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@ public class TextPayloadParserTest
|
|||
public void testFrameTooLargeDueToPolicy() throws Exception
|
||||
{
|
||||
WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
|
||||
policy.setBufferSize(1024); // set policy to something TEENY
|
||||
// Artificially small buffer/payload
|
||||
policy.setBufferSize(512);
|
||||
policy.setMaxPayloadSize(1024);
|
||||
byte utf[] = new byte[2048];
|
||||
Arrays.fill(utf,(byte)'a');
|
||||
|
||||
|
|
Loading…
Reference in New Issue