Fix RFC 7230 violation

See https://github.com/nodejs/node/issues/47528 for more details
See https://github.com/me-no-dev/ESPAsyncWebServer/pull/1301 for original PR from @zalupoi
This commit is contained in:
За Лупой
2023-04-12 17:31:27 +00:00
committed by Mathieu Carbou
parent 0f71c519a7
commit 9c0fb7a98a

View File

@@ -492,9 +492,7 @@ size_t AsyncAbstractResponse::_ack(AsyncWebServerRequest* request, size_t len, u
free(buf); free(buf);
return 0; return 0;
} }
outLen = sprintf_P((char*)buf + headLen, PSTR("%x"), readLen) + headLen; outLen = sprintf((char*)buf+headLen, "%04x", readLen) + headLen;
while (outLen < headLen + 4)
buf[outLen++] = ' ';
buf[outLen++] = '\r'; buf[outLen++] = '\r';
buf[outLen++] = '\n'; buf[outLen++] = '\n';
outLen += readLen; outLen += readLen;