diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index f8522b5b..6baf2c71 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1089,8 +1089,8 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context, } strtolower(wsi->utf8_token[WSI_TOKEN_HTTP].token); - if (strcmp(wsi->utf8_token[WSI_TOKEN_HTTP].token, - "101 websocket protocol handshake")) { + if (strncmp(wsi->utf8_token[WSI_TOKEN_HTTP].token, + "101", 3)) { fprintf(stderr, "libwebsocket_client_handshake " "server sent bad HTTP response '%s'\n", wsi->utf8_token[WSI_TOKEN_HTTP].token); @@ -1145,8 +1145,7 @@ lws_client_interpret_server_handshake(struct libwebsocket_context *context, */ strtolower(wsi->utf8_token[WSI_TOKEN_HTTP].token); - if (strcmp(wsi->utf8_token[WSI_TOKEN_HTTP].token, - "101 switching protocols")) { + if (strncmp(wsi->utf8_token[WSI_TOKEN_HTTP].token, "101", 3)) { fprintf(stderr, "libwebsocket_client_handshake " "server sent bad HTTP response '%s'\n", wsi->utf8_token[WSI_TOKEN_HTTP].token);