correct validation of the request (request line + headers)

This commit is contained in:
Benjamin Sergeant
2019-01-03 13:41:06 -08:00
parent 97255fbd62
commit e964a0a1f0
3 changed files with 92 additions and 3 deletions

View File

@ -155,7 +155,13 @@ TEST_CASE("Websocket_server", "[websocket_server]")
bool success = socket.connect(host, port, errMsg, isCancellationRequested);
REQUIRE(success);
socket.writeBytes("GET /\r\nSec-WebSocket-Key: foobar\r\n\r\n", isCancellationRequested);
socket.writeBytes("GET / HTTP/1.1\r\n"
"Upgrade: websocket\r\n"
"Sec-WebSocket-Version: 13\r\n"
"Sec-WebSocket-Key: foobar\r\n"
"\r\n",
isCancellationRequested);
auto lineResult = socket.readLine(isCancellationRequested);
auto lineValid = lineResult.first;
auto line = lineResult.second;