html: add noto sans subset
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user