The webserver crashes when the HTTP version number is large or a string.

Description of error: The web server crashes when the client sends an HTTP request with a large version number or a string. This is because the server is trying to cast to float. The server writes out the following message:

terminate called after throwing an instance of 'std::out_of_range'  what():  stof
Aborted

Information about OS: WSL 2 with Ubuntu 20.04 LTS.

How to reproduce the error: Run the webserver as described in README.md. Use Alternative 2 to run the client. Send in the following HTTP request:

GET / HTTP/9999999999999999969999999999999999999999

or

GET / HTTP/abcd

or any other large number/string. The webserver will crash, and you will be presented with the error described above.

Backtrace: https://pastebin.ubuntu.com/p/mb6QvgNgnb/

Edited by Dilawar Mahmood