summaryrefslogtreecommitdiff
path: root/libsoup/soup-websocket-connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'libsoup/soup-websocket-connection.c')
-rw-r--r--libsoup/soup-websocket-connection.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c
index a41f05cd..03647413 100644
--- a/libsoup/soup-websocket-connection.c
+++ b/libsoup/soup-websocket-connection.c
@@ -921,6 +921,15 @@ process_frame (SoupWebsocketConnection *self)
return FALSE;
}
+ if (self->pv->connection_type == SOUP_WEBSOCKET_CONNECTION_SERVER && !masked) {
+ /* The server MUST close the connection upon receiving a frame
+ * that is not masked.
+ */
+ g_debug ("The client should always mask frames");
+ protocol_error_and_close (self);
+ return FALSE;
+ }
+
/* We do not support extensions, reserved bits must be 0 */
if (header[0] & 0x70) {
protocol_error_and_close (self);