aboutsummaryrefslogtreecommitdiff
path: root/src/EventManager.cpp
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2021-10-23 01:44:37 +0200
committerToni Uhlig <matzeton@googlemail.com>2021-10-23 01:44:37 +0200
commitca7ca2218e07a24075cdc9d48e967cfdc2a3543b (patch)
tree69d0c5d6c0d064770a04b07faf005bc4fbbe7757 /src/EventManager.cpp
parent09f45879c2b2e63689265924cb700dee5f02f653 (diff)
Improved Blog/Markdown URI base path handling.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/EventManager.cpp')
-rw-r--r--src/EventManager.cpp6
1 files changed, 4 insertions, 2 deletions
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 = "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
+ static char const * const page_404 =
+ "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<html>\n"
"\t<head><title>404 Not Found</title></head>\n"
"\t<body><h1>Not Found</h1>The requested URI was not found.</body>\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());
}