Explorar o código

httpd: add a few more MIME types that we might want

Some more MIME file types that it seems more than plausible we might
want at some point in the future. Change the default type to
text/plain.
H. Peter Anvin %!s(int64=2) %!d(string=hai) anos
pai
achega
140bfad045
Modificáronse 4 ficheiros con 13 adicións e 6 borrados
  1. 13 6
      esp32/max80/httpd.c
  2. BIN=BIN
      esp32/output/max80.ino.bin
  3. BIN=BIN
      fpga/output/v1.fw
  4. BIN=BIN
      fpga/output/v2.fw

+ 13 - 6
esp32/max80/httpd.c

@@ -59,12 +59,19 @@ struct mime_type {
 };
 
 static const struct mime_type mime_types[] = {
-    { ".html", 5, "text/html"                },
-    { ".css",  4, "text/css"                  },
-    { ".txt",  4, "text/plain; charset=UTF-8" },
-    { ".bin",  4, "application/octet-stream"  },
-    { ".fw",   3, "application/octet-stream"  },
-    { NULL,    0, "text/html"  } /* Default */
+    { ".html",  5, "text/html"                 },
+    { ".xhtml", 6, "text/html"                 },
+    { ".css",   4, "text/css"                  },
+    { ".webp",  5, "image/webp"                },
+    { ".jpg",   4, "image/jpeg"                },
+    { ".png",   4, "image/png"                 },
+    { ".ico",   4, "image/png"                 }, /* favicon.ico */
+    { ".svg",   4, "image/svg+xml"             },
+    { ".pdf",   4, "application/pdf"           },
+    { ".xml",   4, "text/xml"                  },
+    { ".bin",   4, "application/octet-stream"  },
+    { ".fw",    3, "application/octet-stream"  },
+    { NULL,     0, "text/plain; charset=UTF-8" }  /* default */
 };
 
 static esp_err_t httpd_static_handler(httpd_req_t *req)

BIN=BIN
esp32/output/max80.ino.bin


BIN=BIN
fpga/output/v1.fw


BIN=BIN
fpga/output/v2.fw