kaazing / gateway

Kaazing Gateway
Apache License 2.0
141 stars 84 forks source link

WsnConnector does not reject a masked text or binary frame from the server #308

Closed sanjay-saxena closed 8 years ago

sanjay-saxena commented 9 years ago

When Gateway is acting as a client, if the server violates RFC 6455 by sending a masked frame(BINARY or TEXT), then Gateway (WsnConnector) just treats the message normally instead of failing the connection, as seen in the following tests under transport/wsn module in org.kaazing.gateway.transport.wsn.specification.ws.connector package:

  1. MaskingIT.shouldFailWebSocketConnectionWhenServerSendsMaskWithTextFrame()
  2. MaskingIT.shouldFailWebSocketConnectionWhenServerSendsMaskWithBinaryFrame()

Gateway (i.e. WsnConnector) should instead respond with a CLOSE frame with 1002 code.

danibusu commented 8 years ago

Raised PR with the fix.