summaryrefslogtreecommitdiffstats
path: root/src/afb-hswitch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/afb-hswitch.c')
-rw-r--r--src/afb-hswitch.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/afb-hswitch.c b/src/afb-hswitch.c
index 8dee80b3..417b773e 100644
--- a/src/afb-hswitch.c
+++ b/src/afb-hswitch.c
@@ -86,6 +86,11 @@ int afb_hswitch_websocket_switch(struct afb_hreq *hreq, void *data)
return 1;
}
+ if (!hreq->context.validated) {
+ afb_hreq_reply_error(hreq, MHD_HTTP_UNAUTHORIZED);
+ return 1;
+ }
+
return afb_websock_check_upgrade(hreq);
}