Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

IOS 18 and latest Safari cannot diplay websites with http header Transfer-Encoding chunked #1445

@konmax8053

Description

@konmax8053

Since upgrading my iPhone to IOS 18 all my ESP32 hosted web sites do not work anymore. The Safari browser only shows a blank page with nothing more than "cannot parse response". The reason seems to be the http header "Transfer-Encoding" with value "chunked" and no content length in the header. This type of headers are produced if a "processor" function is used while generating the response.

Example:

// Route for root / web page
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/html", index_html, processor);
});

This code results in http headers like this:

"headers": [
{
"name": "Accept-Ranges",
"value": "none"
},
{
"name": "Connection",
"value": "close"
},
{
"name": "Transfer-Encoding",
"value": "chunked"
},
{
"name": "Content-Type",
"value": "text/html"
}
]

Using a code like this (without a processor):

// Route for root / web page
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
request->send_P(200, "text/html", index_html);
});

results in http headers like this:

"headers": [
{
"name": "Accept-Ranges",
"value": "none"
},
{
"name": "Connection",
"value": "close"
},
{
"name": "Content-Length",
"value": "1990"
},
{
"name": "Content-Type",
"value": "text/html"
}
]

Such a response can be rendered by Safari. The first one can not.

Thanks
Konrad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions