fix: check for pendingUrls desync
This commit is contained in:
@@ -481,7 +481,20 @@ void TinyMITMProxy::handleClient(SOCKET clientSocket)
|
|||||||
|
|
||||||
if (complete)
|
if (complete)
|
||||||
{
|
{
|
||||||
std::string url = pendingUrls.back();
|
if (pendingUrls.empty())
|
||||||
|
{
|
||||||
|
TINYMITM_WRITELOG(error,
|
||||||
|
"Pending URLs empty but request complete for {}. This shouldn't "
|
||||||
|
"happen, resetting stream. Buffer size: {}",
|
||||||
|
host, clientStream.buffer.size());
|
||||||
|
|
||||||
|
clientStream.buffer.erase(0, totalRequestSize);
|
||||||
|
clientStream.reset();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string url = pendingUrls.front();
|
||||||
|
pendingUrls.pop_front();
|
||||||
std::string headers = clientStream.buffer.substr(0, clientStream.headersEnd + 4);
|
std::string headers = clientStream.buffer.substr(0, clientStream.headersEnd + 4);
|
||||||
|
|
||||||
removeHeader(headers, "Accept-Encoding");
|
removeHeader(headers, "Accept-Encoding");
|
||||||
|
|||||||
Reference in New Issue
Block a user