mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-08 04:26:58 +03:00
Merge branch 'rolling' into update-webui
This commit is contained in:
@@ -844,11 +844,9 @@ static esp_err_t delete_post_handler(httpd_req_t *req)
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
if (stat(filepath, &file_stat) == -1) {
|
||||
LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "File does not exist: " + string(filename));
|
||||
/* Respond with 400 Bad Request */
|
||||
httpd_resp_send_err(req, HTTPD_400_BAD_REQUEST, "File does not exist");
|
||||
return ESP_FAIL;
|
||||
if (stat(filepath, &file_stat) == -1) { // File does not exist
|
||||
/* This is ok, we would delete it anyway */
|
||||
LogFile.WriteToFile(ESP_LOG_INFO, TAG, "File does not exist: " + string(filename));
|
||||
}
|
||||
|
||||
/* Delete file */
|
||||
@@ -894,6 +892,7 @@ static esp_err_t delete_post_handler(httpd_req_t *req)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
httpd_resp_set_hdr(req, "Location", directory.c_str());
|
||||
httpd_resp_sendstr(req, "File successfully deleted");
|
||||
return ESP_OK;
|
||||
|
||||
Reference in New Issue
Block a user