fix: change port parsing

This commit is contained in:
2026-05-13 11:33:45 -03:00
parent 0945f97fc6
commit bb9326c5a2
+2 -2
View File
@@ -305,8 +305,8 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket)
/*
port parsing
*/
size_t space = req.find(' ', 8);
std::string fullHost = req.substr(8, space - 8);
size_t endOfHost = req.find_first_of(" \r\n", 8);
std::string fullHost = req.substr(8, endOfHost - 8);
size_t colon = fullHost.find(':');
std::string host = (colon != std::string::npos) ? fullHost.substr(0, colon) : fullHost;
std::string port = (colon != std::string::npos) ? fullHost.substr(colon + 1) : "443";