afb-hswitch: Update websocket policy 61/23161/1
authorJose Bollo <jose.bollo@iot.bzh>
Sat, 16 Nov 2019 08:30:51 +0000 (09:30 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Mon, 2 Dec 2019 09:18:12 +0000 (10:18 +0100)
The previous policy for websocket was to enforce them
to present a valid token when establishing. This policy
is removed because the Websocket API of javascript doesn't
provide a way to set the Bearer token in the HTTP header
of the negociation (a big miss in my opinion).

But because the new policy of token logic is to check
the token at each request, it is not more needed to check
it at establishment.

Bug-AGL: SPEC-2968

Change-Id: I2941757492a27a2eed14e26fbb411330ab4aa8bc
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
src/afb-hswitch.c

index b4692bc..ab9e94b 100644 (file)
@@ -101,11 +101,6 @@ int afb_hswitch_websocket_switch(struct afb_hreq *hreq, void *data)
                return 1;
        }
 
-       if (!hreq->xreq.context.validated) {
-               afb_hreq_reply_error(hreq, MHD_HTTP_UNAUTHORIZED);
-               return 1;
-       }
-
        return afb_websock_check_upgrade(hreq, apiset);
 }