1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-06 10:50:58 +01:00

Remove Content-Length header from camera snapshot response (#2860)

* Update camera_web_server.cpp

Removed the duplicated CONTENT_LENGTH header

* Update camera_web_server.cpp

* Update camera_web_server.cpp
This commit is contained in:
Daniel Hyles 2021-12-28 07:32:17 +11:00 committed by GitHub
parent 72c6bfaa50
commit c6956527d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,9 +233,6 @@ esp_err_t CameraWebServer::snapshot_handler_(struct httpd_req *req) {
httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg"); httpd_resp_set_hdr(req, "Content-Disposition", "inline; filename=capture.jpg");
if (res == ESP_OK) {
res = httpd_resp_set_hdr(req, CONTENT_LENGTH, esphome::to_string(image->get_data_length()).c_str());
}
if (res == ESP_OK) { if (res == ESP_OK) {
res = httpd_resp_send(req, (const char *) image->get_data_buffer(), image->get_data_length()); res = httpd_resp_send(req, (const char *) image->get_data_buffer(), image->get_data_length());
} }