From 74876b38b08108332e1b0f517c3828f1fb329e0b Mon Sep 17 00:00:00 2001 From: Vaxry Date: Mon, 21 Apr 2025 02:14:36 +0100 Subject: [PATCH] handler: allow /git-upload-pack for git hosts ref #20 --- src/core/Handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Handler.cpp b/src/core/Handler.cpp index 0570774..d8cac1d 100644 --- a/src/core/Handler.cpp +++ b/src/core/Handler.cpp @@ -201,8 +201,8 @@ void CServerHandler::onRequest(const Pistache::Http::Request& req, Pistache::Htt if (g_pConfig->m_config.git_host) { // TODO: ratelimit this, probably. - const auto RES = req.resource(); - bool validGitResource = RES.ends_with("/info/refs") || RES.ends_with("/info/packs") || RES.ends_with("HEAD") || RES.ends_with(".git"); + const auto RES = req.resource(); + bool validGitResource = RES.ends_with("/info/refs") || RES.ends_with("/info/packs") || RES.ends_with("HEAD") || RES.ends_with(".git") || RES.ends_with("/git-upload-pack"); if (RES.contains("/objects/")) { const std::string_view repo = std::string_view{RES}.substr(0, RES.find("/objects/"));