(perf) Remove interesting headers to fasten request processing

All headers are already parsed: interesting headers allowed to cleanup parsed headers to only keep interesting ones during request processing.
Removing "interesting headers" support will keep these parsed headers in heap memory during request processing before being freed at the end of the request.
If you really need to cleanup some headers to get more heap space during request processing, use a middleware and removeHeadersExcept(names) to remove some.
This commit is contained in:
Mathieu Carbou
2024-09-09 17:03:27 +02:00
parent 958f764c48
commit b4460a2a70
11 changed files with 59 additions and 59 deletions

View File

@@ -1078,13 +1078,6 @@ bool AsyncWebSocket::canHandle(AsyncWebServerRequest* request) {
if (request->method() != HTTP_GET || !request->url().equals(_url) || !request->isExpectedRequestedConnType(RCT_WS))
return false;
request->addInterestingHeader(WS_STR_CONNECTION);
request->addInterestingHeader(WS_STR_UPGRADE);
request->addInterestingHeader(WS_STR_ORIGIN);
request->addInterestingHeader(WS_STR_COOKIE);
request->addInterestingHeader(WS_STR_VERSION);
request->addInterestingHeader(WS_STR_KEY);
request->addInterestingHeader(WS_STR_PROTOCOL);
return true;
}