From 2ef28475cd9bece750c41634c5528a4497cbae88 Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 22 Aug 2022 14:37:40 +0200 Subject: [PATCH] Fix mimetype handling in the simle server. Also added a few misisng ones. --- modules/http_server_simple/http_server_simple.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/http_server_simple/http_server_simple.cpp b/modules/http_server_simple/http_server_simple.cpp index 153285e20..eb8a2d5e0 100644 --- a/modules/http_server_simple/http_server_simple.cpp +++ b/modules/http_server_simple/http_server_simple.cpp @@ -179,7 +179,7 @@ void HTTPServerConnection::send_file(Ref request, const String String ctype; String req_ext = p_file_path.get_extension(); - if (!_http_server->mimes.has(req_ext)) { + if (_http_server->mimes.has(req_ext)) { ctype = _http_server->mimes[req_ext]; } else { ctype = "text/plain"; @@ -385,7 +385,10 @@ HTTPServerSimple::HTTPServerSimple() { mimes["pck"] = "application/octet-stream"; mimes["png"] = "image/png"; mimes["svg"] = "image/svg"; + mimes["jpg"] = "image/jpeg"; + mimes["jpeg"] = "image/jpeg"; mimes["wasm"] = "application/wasm"; + mimes["css"] = "text/css"; server.instance(); stop();