Skip to content
Snippets Groups Projects
Commit 07eeeb77 authored by Terje Haugum's avatar Terje Haugum
Browse files

Added try-catch in server_http.hpp around the http_version. If it fails, it is set to 1.1

parent c0bfd99e
No related branches found
No related tags found
No related merge requests found
Pipeline #46734 failed
......@@ -739,7 +739,13 @@ namespace SimpleWeb {
return;
}
}
if(std::stof(response->session->request->http_version) >= 1.1) {
float http_VersionF;
try{
http_VersionF = std::stof(response->session->request->http_version);
}catch (std::exception e){
http_VersionF = 1.1;
}
if(http_VersionF >= 1.1) {
auto new_session = std::make_shared<Session>(this->config.max_request_streambuf_size, response->session->connection);
this->read(new_session);
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment