Closed hakkapet closed 2 months ago
I have just run into the exact same issue. I think the problem is that the Content-Type
and Content-Length
headers are missing when using a processor. As a work-around, I added the Content-Type
header, but I'm not sure yet how to calculate the content length there...
AsyncWebServerResponse* response = request->beginResponse(LittleFS, "/index.html", String(), false, processor);
response->addHeader("Content-Type", "text/html; charset=UTF-8");
request->send(response);
I examined response (in Edge, only have iphone so cannot debug) and library adds Content-Type header, even without addHeader. Response Transfer-Encoding is "chunked" so Content-Length is omitted. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding However i havent yet explored how that lib handles chunked responses. I think it is something to do with that.
Apparently there's a PR open with a fix for this issue: https://github.com/me-no-dev/ESPAsyncWebServer/pull/1301/ (linking this discussion for more context).
@nonnullish thanks! i checked that another fork by @mathieucarbou it is much better and works also with IOS18
Yes, we are maintaining it at https://oss.carbou.me/ESPAsyncWebServer/ and it has a lot more features, like middlewares ;-)
And the fix https://github.com/me-no-dev/ESPAsyncWebServer/pull/1301 is already in.
Hi, just noticed that some reason when Iphone is updated to IOS18. Template processing wont work anymore in Safari browser: It just gives an "cannot parse response" error to Safari. So i this is Safari/IOS18 error, but it would be nice to know why this wont work anymore. It is crucial functionality almost everywhere in web applications. Other browsers (Chrome) what i was trying to use works fine. Some reason return page from AwsTemplateProcessor is interpreted as faulty in Safari.
Example this wont work anymore:
or this wont work:
Without processor it gives page without problem.
request->send_p(200, "text/html", html);
Even if processor is so simple that: