get_websocket_version now checks if request is complete
an incomplete request otherwise would produce a spurious zero value
This commit is contained in:
1 parent
1f061a920e
commit
768472c0d4
1 file changed
+4
@@ -105,6 +105,10 @@ bool is_websocket_handshake(request_type& r) {
|
||||
*/
|
||||
template <typename request_type>
|
||||
int get_websocket_version(request_type& r) {
|
||||
if (!r.ready()) {
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (r.get_header("Sec-WebSocket-Version") == "") {
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user