Explorar o código

Try to clear cache after intial setup

Slider0007 %!s(int64=2) %!d(string=hai) anos
pai
achega
9f97a2b223
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      code/components/jomjol_fileserver_ota/server_help.cpp

+ 7 - 1
code/components/jomjol_fileserver_ota/server_help.cpp

@@ -61,7 +61,13 @@ esp_err_t send_file(httpd_req_t *req, std::string filename)
         endsWith(filename, ".jpeg") ||
         endsWith(filename, ".jpeg") ||
         endsWith(filename, ".ico") ||
         endsWith(filename, ".ico") ||
         endsWith(filename, ".png")) {
         endsWith(filename, ".png")) {
-        httpd_resp_set_hdr(req, "Cache-Control", "max-age=86400");
+
+    	if (filename == "/sdcard/html/setup.html") {    
+            httpd_resp_set_hdr(req, "Clear-Site-Data", "\"*\"");
+        }
+        else {
+            httpd_resp_set_hdr(req, "Cache-Control", "max-age=86400");
+        }
     }
     }
 
 
     set_content_type_from_file(req, filename.c_str());
     set_content_type_from_file(req, filename.c_str());