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:
parent
f2e5e985c3
commit
d515ddd51d
1 changed files with 3 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue