use starts_with instead std::compare

This commit is contained in:
orignal
2026-10-03 12:51:40 -04:00
parent 76fc49a886
commit ecb5d1d063
+3 -3
View File
@@ -401,7 +401,7 @@ namespace client
if (line == "\r") endOfHeader = true;
else
{
if (!m_ConnectionSent && !line.compare(0, 10, "Connection"))
if (!m_ConnectionSent && line.starts_with ("Connection"))
{
/* close connection, if not Connection: (U|u)pgrade (for websocket) */
auto x = line.find("pgrade");
@@ -412,7 +412,7 @@ namespace client
m_ConnectionSent = true;
}
else if (!m_ProxyConnectionSent && !line.compare(0, 16, "Proxy-Connection"))
else if (!m_ProxyConnectionSent && line.starts_with ("Proxy-Connection"))
{
m_OutHeader << "Proxy-Connection: close\r\n";
m_ProxyConnectionSent = true;
@@ -569,7 +569,7 @@ namespace client
};
bool matched = false;
for (const auto& it: excluded)
if (!line.compare(0, it.length (), it))
if (line.starts_with (it))
{
matched = true;
break;