From 3f7d0504720891fc5326aad51082bdd44f0c2a26 Mon Sep 17 00:00:00 2001 From: Jackarain Date: Thu, 19 Sep 2024 22:59:52 +0800 Subject: [PATCH] Fix const map access --- proxy/include/proxy/proxy_server.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/include/proxy/proxy_server.hpp b/proxy/include/proxy/proxy_server.hpp index 0759dbe00..4cc55e7e5 100644 --- a/proxy/include/proxy/proxy_server.hpp +++ b/proxy/include/proxy/proxy_server.hpp @@ -3948,7 +3948,7 @@ R"x*x*x( res.set(http::field::date, server_date_string()); auto ext = strutil::to_lower(index_html.extension().string()); if (global_mimes.count(ext)) - res.set(http::field::content_type, global_mimes[ext]); + res.set(http::field::content_type, global_mimes.at(ext)); else res.set(http::field::content_type, "text/plain"); res.keep_alive(request.keep_alive()); @@ -4184,7 +4184,7 @@ R"x*x*x( auto ext = strutil::to_lower(fs::path(path).extension().string()); if (global_mimes.count(ext)) - res.set(http::field::content_type, global_mimes[ext]); + res.set(http::field::content_type, global_mimes.at(ext)); else res.set(http::field::content_type, "text/plain");