diff --git a/src/main.cpp b/src/main.cpp index d4b2ebd..bdd97d5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,7 +32,8 @@ struct page_handler void operator()(const httplib::Request& req, httplib::Response& res) { std::string data_content = Files::load(path); - std::string page = std::vformat(DATA_INDEX, std::make_format_args(get_theme(req), data_content)); + std::string theme = get_theme(req); + std::string page = std::vformat(DATA_INDEX, std::make_format_args(theme, data_content)); res.set_content(page, "text/html"); } }; @@ -72,7 +73,8 @@ void put_contact(const httplib::Request& req, httplib::Response& res) void error_handler(const httplib::Request& req, httplib::Response& res) { - std::string page = std::vformat(DATA_INDEX, std::make_format_args(get_theme(req), DATA_ERROR)); + std::string theme = get_theme(req); + std::string page = std::vformat(DATA_INDEX, std::make_format_args(theme, DATA_ERROR)); res.set_content(page, "text/html"); }