Remove Content-Length header from chunked response

HTTP does not allow Content-Length header to be set when Transfer-Encoding is present (https://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.4.4)

When chunked, Transfer-Encoding is set. This causes issues, for example when adding the camera to HomeAssistant, since it causes an error in the http library.

This commit removes the Content-Length header in this case.
pull/136/head
Sebastian Österlund 2026-02-24 09:46:17 +01:00 committed by GitHub
parent db0112e9c2
commit 0648a513e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -64,7 +64,6 @@ void Server_InitWebServer() {
}
return len;
});
response->addHeader("Content-Length", String(total_len));
request->send(response);
} else {
@ -1350,3 +1349,4 @@ String Server_TranslateBoolToString(bool i_data) {
}
/* EOF */