Which is bad, because it sends the Content-Length twice, once with the incorrect value of 0 and once with the correct Data size. Notice, in the HEAD request we must specify the data's correct Content-Length but MUST NOT send any content whatsover.
If I do response->setContentLength(15); for example, then ESPAsyncWebServer will send 15 bytes of unknown memory to the client which is obviously invalid.
I would prefer to do something like this:
Instead, I have to do this:
Which is bad, because it sends the
Content-Length
twice, once with the incorrect value of0
and once with the correct Data size. Notice, in theHEAD
request we must specify the data's correct Content-Length but MUST NOT send any content whatsover.If I do
response->setContentLength(15);
for example, then ESPAsyncWebServer will send 15 bytes of unknown memory to the client which is obviously invalid.