get_websocket_version now checks if request is complete

an incomplete request otherwise would produce a spurious zero value
This commit is contained in:
Peter Thorson committed 2014-12-12 18:07:32 -05:00
1 parent 1f061a920e
commit 768472c0d4
1 file changed
+4
+4
View File
@@ -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;
}