Skip to content

Remove Content-Length header from chunked response#136

Open
sirmc wants to merge 1 commit intoprusa3d:masterfrom
sirmc:patch-1
Open

Remove Content-Length header from chunked response#136
sirmc wants to merge 1 commit intoprusa3d:masterfrom
sirmc:patch-1

Conversation

@sirmc
Copy link

@sirmc sirmc commented Feb 24, 2026

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. A visible result of this error is that HomeAssistant doesn't show the saved-photo.jpeg (http://esp32cam-name.local/saved-photo.jpg) in a dashboard view,

This commit removes the Content-Length header in this case. Tested, and the fix seems to allow showing the saved-photo.jpeg in the dashboard in HomeAssistant.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant