diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..7f6a85b5d426f718d248892ca4fa026ae2de25fd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,69 @@ +{ + "files.associations": { + "cctype": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "csignal": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "array": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "chrono": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "condition_variable": "cpp", + "cstdint": "cpp", + "deque": "cpp", + "list": "cpp", + "unordered_map": "cpp", + "unordered_set": "cpp", + "vector": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "map": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "optional": "cpp", + "random": "cpp", + "ratio": "cpp", + "regex": "cpp", + "set": "cpp", + "string": "cpp", + "string_view": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "initializer_list": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "ostream": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "cinttypes": "cpp", + "typeindex": "cpp", + "typeinfo": "cpp" + } +} \ No newline at end of file diff --git a/server_http.hpp b/server_http.hpp index 606b76fa7b20d0ca22876b905539dfd6a5611b87..1f6f1541f505d27697e7147b42cec192607f6eb9 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -763,19 +763,24 @@ namespace SimpleWeb { } } + float var = -1.0; + 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; - }else{ + var = std::stof(response->session->request->http_version); + + + + }catch(const std::exception &){ return; } - - + if(var >= 1.1) { + auto new_session = std::make_shared<Session>(this->config.max_request_streambuf_size, response->session->connection); + this->read(new_session); + return; + } } else if(this->on_error)