From 424546a24e5804a4432bbe58b2f61c45366b3293 Mon Sep 17 00:00:00 2001
From: Herman <hermanrm@stud.ntnu.no>
Date: Wed, 28 Aug 2019 12:10:00 +0200
Subject: [PATCH] Bug fix

---
 server_http.hpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/server_http.hpp b/server_http.hpp
index 219ea1e..8088377 100644
--- a/server_http.hpp
+++ b/server_http.hpp
@@ -739,11 +739,13 @@ 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 &) {return;}
           }
           else if(this->on_error)
             this->on_error(response->session->request, ec);
-- 
GitLab