mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
confirm upgrade actually for websocket
Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
parent
104316eb8f
commit
2af585660d
1 changed files with 10 additions and 0 deletions
10
lib/server.c
10
lib/server.c
|
@ -354,6 +354,16 @@ int lws_handshake_server(struct libwebsocket_context *context,
|
|||
return 0; /* don't bail out of libwebsocket_read, just yet */
|
||||
}
|
||||
|
||||
if (!strcasecmp(lws_hdr_simple_ptr(wsi, WSI_TOKEN_UPGRADE),
|
||||
"websocket"))
|
||||
goto upgrade_ws;
|
||||
|
||||
|
||||
/* dunno what he wanted to upgrade to */
|
||||
goto bail_nuke_ah;
|
||||
|
||||
|
||||
upgrade_ws:
|
||||
if (!wsi->protocol)
|
||||
lwsl_err("NULL protocol at libwebsocket_read\n");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue