From 2e8a81ea7e9758a338f9a85be8063064f867ab7d Mon Sep 17 00:00:00 2001 From: sigurlj <sigurlj@stud.ntnu.no> Date: Fri, 30 Aug 2019 00:31:11 +0200 Subject: [PATCH] Fixed version bug --- server_http.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server_http.hpp b/server_http.hpp index 219ea1e..d482ec6 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -739,11 +739,16 @@ namespace SimpleWeb { 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::cout << "Invalid http version"; + } + } else if(this->on_error) this->on_error(response->session->request, ec); -- GitLab