feat: create recognizable Early-20th-Century Warship Silhouettes
This commit is contained in:
+1
-1
@@ -337,7 +337,7 @@ static esp_err_t send_static_file(httpd_req_t *request, const char *asset_path)
|
||||
FILE *file = fopen(path_to_open, "rb");
|
||||
if (file == NULL) return httpd_resp_send_err(request, HTTPD_404_NOT_FOUND, "static asset not found");
|
||||
httpd_resp_set_type(request, mime_type_for_path(asset_path));
|
||||
httpd_resp_set_hdr(request, "Cache-Control", strcmp(asset_path, "/index.html") == 0 ? "no-cache" : "public, max-age=86400");
|
||||
httpd_resp_set_hdr(request, "Cache-Control", "no-cache");
|
||||
if (gzip) { httpd_resp_set_hdr(request, "Content-Encoding", "gzip"); httpd_resp_set_hdr(request, "Vary", "Accept-Encoding"); }
|
||||
char chunk[kFileChunkBytes]; size_t read = 0U; esp_err_t result = ESP_OK;
|
||||
while ((read = fread(chunk, 1U, sizeof(chunk), file)) > 0U && result == ESP_OK) result = httpd_resp_send_chunk(request, chunk, read);
|
||||
|
||||
Reference in New Issue
Block a user