diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index 655d9aaf82..e714dafcc5 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -96,6 +96,13 @@ class StaticRequestHandler : public RequestHandler { String contentType = getContentType(path); + // If content type not matched on path, then try for uri + // Useful for minified javascript et al. + if (contentType.equals("application/octet-stream")) + { + contentType = getContentType(requestUri); + } + // look for gz file, only if the original specified path is not a gz. So part only works to send gzip via content encoding when a non compressed is asked for // if you point the the path to gzip you will serve the gzip as content type "application/x-gzip", not text or javascript etc... if (!path.endsWith(".gz") && !_fs.exists(path)) {