html: add noto sans subset

This commit is contained in:
Vaxry
2025-04-13 16:53:17 +01:00
parent 5a0d332466
commit b5ee8880ff
6 changed files with 20 additions and 3 deletions

View File

@@ -145,6 +145,10 @@ std::string CServerHandler::fingerprintForRequest(const Pistache::Http::Request&
return sha256(input);
}
bool CServerHandler::isResourceCheckpoint(const std::string_view& res) {
return res == "/checkpoint/NotoSans.woff";
}
void CServerHandler::onRequest(const Pistache::Http::Request& req, Pistache::Http::ResponseWriter response) {
const auto HEADERS = req.headers();
std::shared_ptr<const Pistache::Http::Header::Host> hostHeader;
@@ -218,6 +222,12 @@ void CServerHandler::onRequest(const Pistache::Http::Request& req, Pistache::Htt
return;
}
if (isResourceCheckpoint(req.resource())) {
response.send(Pistache::Http::Code::Ok,
readFileAsText(g_pGlobalState->cwd + "/" + g_pConfig->m_config.html_dir + "/" + req.resource().substr(req.resource().find("checkpoint/") + 11)));
return;
}
if (g_pConfig->m_config.git_host) {
// TODO: ratelimit this, probably.