We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I supose it's only nedded to add a line here:
static String getContentType(const String& path) { if (path.endsWith(".html")) return "text/html"; else if (path.endsWith(".htm")) return "text/html"; else if (path.endsWith(".css")) return "text/css"; else if (path.endsWith(".txt")) return "text/plain"; else if (path.endsWith(".js")) return "application/javascript"; else if (path.endsWith(".png")) return "image/png"; else if (path.endsWith(".gif")) return "image/gif"; else if (path.endsWith(".jpg")) return "image/jpeg"; else if (path.endsWith(".ico")) return "image/x-icon"; else if (path.endsWith(".svg")) return "image/svg+xml"; else if (path.endsWith(".xml")) return "text/xml"; else if (path.endsWith(".pdf")) return "application/pdf"; else if (path.endsWith(".zip")) return "application/zip"; else if (path.endsWith(".ttf")) return "font/ttf"; else if(path.endsWith(".gz")) return "application/x-gzip"; return "application/octet-stream"; }
The line added worksforme!
The text was updated successfully, but these errors were encountered:
correct it's there ;) I added font/woff and font/woff2 for bootstrap in my code also
I strongly recommend activate browser caching for SPIFFS to avoid requesting font each time server.serveStatic("/", SPIFFS, "/", "max-age=86400");
server.serveStatic("/", SPIFFS, "/", "max-age=86400");
Sorry, something went wrong.
e23e4d9
Merge pull request #1724 from marvinroger/patch-1
c78c37b
Add font MIME types, fix #1601
No branches or pull requests
I supose it's only nedded to add a line here:
static String getContentType(const String& path) {
if (path.endsWith(".html")) return "text/html";
else if (path.endsWith(".htm")) return "text/html";
else if (path.endsWith(".css")) return "text/css";
else if (path.endsWith(".txt")) return "text/plain";
else if (path.endsWith(".js")) return "application/javascript";
else if (path.endsWith(".png")) return "image/png";
else if (path.endsWith(".gif")) return "image/gif";
else if (path.endsWith(".jpg")) return "image/jpeg";
else if (path.endsWith(".ico")) return "image/x-icon";
else if (path.endsWith(".svg")) return "image/svg+xml";
else if (path.endsWith(".xml")) return "text/xml";
else if (path.endsWith(".pdf")) return "application/pdf";
else if (path.endsWith(".zip")) return "application/zip";
else if (path.endsWith(".ttf")) return "font/ttf";
else if(path.endsWith(".gz")) return "application/x-gzip";
return "application/octet-stream";
}
The line added worksforme!
The text was updated successfully, but these errors were encountered: