fix: change port parsing
This commit is contained in:
@@ -305,8 +305,8 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket)
|
|||||||
/*
|
/*
|
||||||
port parsing
|
port parsing
|
||||||
*/
|
*/
|
||||||
size_t space = req.find(' ', 8);
|
size_t endOfHost = req.find_first_of(" \r\n", 8);
|
||||||
std::string fullHost = req.substr(8, space - 8);
|
std::string fullHost = req.substr(8, endOfHost - 8);
|
||||||
size_t colon = fullHost.find(':');
|
size_t colon = fullHost.find(':');
|
||||||
std::string host = (colon != std::string::npos) ? fullHost.substr(0, colon) : fullHost;
|
std::string host = (colon != std::string::npos) ? fullHost.substr(0, colon) : fullHost;
|
||||||
std::string port = (colon != std::string::npos) ? fullHost.substr(colon + 1) : "443";
|
std::string port = (colon != std::string::npos) ? fullHost.substr(colon + 1) : "443";
|
||||||
|
|||||||
Reference in New Issue
Block a user