Skip to content
Snippets Groups Projects
Commit b6211125 authored by Tollii's avatar Tollii
Browse files

Fixed http version overflow and conversion error

parent 260755ec
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
#include <list>
#include <map>
#include <sstream>
#include <stdexcept>
#include <thread>
#include <unordered_set>
......@@ -762,7 +763,18 @@ namespace SimpleWeb {
return;
}
}
if(std::stof(response->session->request->http_version) >= 1.1) {
auto http_ver_string = response->session->request->http_version;
double http_ver_float;
try {
http_ver_float = std::stof(http_ver_string);
} catch (const std::invalid_argument) {
http_ver_float = 1.0;
}
if(http_ver_float >= 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.
Finish editing this message first!
Please register or to comment