diff --git a/client_https.hpp b/client_https.hpp index dfc4d8f..e5c59ef 100644 --- a/client_https.hpp +++ b/client_https.hpp @@ -95,7 +95,7 @@ namespace SimpleWeb { io_service.run(); auto response=request_read(); - if (response->status_code.empty() || response->status_code.substr(0,3) != "200") { + if (response->status_code.empty() || response->status_code.compare(0, 3, "200") != 0) { std::lock_guard lock(socket_mutex); socket=nullptr; throw boost::system::system_error(boost::system::error_code(boost::system::errc::permission_denied, boost::system::generic_category())); diff --git a/server_http.hpp b/server_http.hpp index 6970bc0..ee0f31f 100644 --- a/server_http.hpp +++ b/server_http.hpp @@ -304,7 +304,7 @@ namespace SimpleWeb { size_t protocol_end; if((protocol_end=line.find('/', path_end+1))!=std::string::npos) { - if(line.substr(path_end+1, protocol_end-path_end-1)!="HTTP") + if(line.compare(path_end+1, protocol_end-path_end-1, "HTTP")!=0) return false; request->http_version=line.substr(protocol_end+1, line.size()-protocol_end-2); }