1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Don't care for the human-readable part of "HTTP/1.1 101" reply

While the protocol specification gives example of the
human-readable message associated with a 101-code reply,
nowhere does it actually enforce it. Ws4py gevent middleware
is known to have a message other than "Switching Protocols".
This commit is contained in:
Artem Egorkine 2011-11-23 10:46:24 +02:00 committed by Andy Green
parent f2e5e985c3
commit d515ddd51d

View file

@ -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);