The mime types dictionary now uses StringName indexes. Also compare against lowercase extensions.

This commit is contained in:
Relintai 2023-08-28 13:38:44 +02:00
parent db14d66556
commit ea5cddc44f
2 changed files with 2 additions and 2 deletions

View File

@ -288,7 +288,7 @@ void HTTPServerConnection::send_file(Ref<WebServerRequest> request, const String
if (!custom_headers.has("Content-Type")) {
String ctype;
String req_ext = p_file_path.get_extension();
StringName req_ext = p_file_path.get_extension().to_lower();
if (_http_server->mimes.has(req_ext)) {
ctype = _http_server->mimes[req_ext];

View File

@ -110,7 +110,7 @@ public:
uint64_t max_request_size;
RBMap<String, String> mimes;
RBMap<StringName, String> mimes;
Ref<X509Certificate> cert;