|
|
@@ -362,7 +362,7 @@ class Websocket
|
|
|
$SecWebSocketKey = $match[1];
|
|
|
} else {
|
|
|
$connection->close(
|
|
|
- "HTTP/1.0 200 OK\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>WebSocket</h1><hr>workerman</div>", true);
|
|
|
+ "HTTP/1.0 400 Bad Request\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>WebSocket</h1><hr>workerman</div>", true);
|
|
|
return 0;
|
|
|
}
|
|
|
// Calculation websocket key.
|
|
|
@@ -414,7 +414,7 @@ class Websocket
|
|
|
$handshakeMessage .= "\r\n";
|
|
|
// Send handshake response.
|
|
|
$connection->send($handshakeMessage, true);
|
|
|
- // Mark handshake complete..
|
|
|
+ // Mark handshake complete.
|
|
|
$connection->context->websocketHandshake = true;
|
|
|
|
|
|
// There are data waiting to be sent.
|
|
|
@@ -429,7 +429,7 @@ class Websocket
|
|
|
}
|
|
|
// Bad websocket handshake request.
|
|
|
$connection->close(
|
|
|
- "HTTP/1.0 200 OK\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>WebSocket</h1><hr>workerman</div>", true);
|
|
|
+ "HTTP/1.0 400 Bad Request\r\nServer: workerman\r\n\r\n<div style=\"text-align:center\"><h1>400 Bad Request</h1><hr>workerman</div>", true);
|
|
|
return 0;
|
|
|
}
|
|
|
}
|