diff --git a/server_http.hpp b/server_http.hpp index 219ea1e6d95f2a7f9b77fd7a7f7a94faa6f8a307..5e10226b05ff9809b7b5b00f0ba4cfcf455a6c92 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -739,11 +739,15 @@ namespace SimpleWeb { return; } } - if(std::stof(response->session->request->http_version) >= 1.1) { - auto new_session = std::make_shared<Session>(this->config.max_request_streambuf_size, response->session->connection); - this->read(new_session); - return; - } + try { + if(std::stof(response->session->request->http_version) >= 1.1) { + auto new_session = std::make_shared<Session>(this->config.max_request_streambuf_size, response->session->connection); + this->read(new_session); + return; + } + } catch (std::exception& e){ + return; + } } else if(this->on_error) this->on_error(response->session->request, ec);