From ca7ca2218e07a24075cdc9d48e967cfdc2a3543b Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Sat, 23 Oct 2021 01:44:37 +0200 Subject: Improved Blog/Markdown URI base path handling. Signed-off-by: Toni Uhlig --- src/EventManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/EventManager.cpp') diff --git a/src/EventManager.cpp b/src/EventManager.cpp index 81b949d..4ca377a 100644 --- a/src/EventManager.cpp +++ b/src/EventManager.cpp @@ -112,7 +112,8 @@ static inline void default_evhttp_callback(struct evhttp_request * const req, Ev struct evbuffer * const output = evbuffer_new(); if (output != nullptr) { - static char const * const page_404 = "\n" + static char const * const page_404 = + "\n" "\n" "\t404 Not Found\n" "\t

Not Found

The requested URI was not found.\n" @@ -190,7 +191,8 @@ bool EventManager::Init(std::string host, uint16_t port) } for (auto & cm : m_ContentManager->GetAllModulesRoutes()) { - if (evhttp_set_cb(m_EvHttp, cm.first.c_str(), EvContentManagerInterceptor, &m_ContentManager) != 0) + if (evhttp_set_cb(m_EvHttp, cm.first.c_str(), EvContentManagerInterceptor, &m_ContentManager) != 0 && + cm.first != "/") { fprintf(stderr, "Failed to add route callback: %s\n", cm.first.c_str()); } -- cgit v1.2.3