aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Resnick <max@ofmax.li>2025-04-06 21:06:23 -0700
committerMax Resnick <max@ofmax.li>2025-04-06 21:06:23 -0700
commit4aad12ef514b43453946428f0cb937a8e0429496 (patch)
tree8e935217d4a5470aabd31ead6d03520328ba705c
parent77624e0a041f826c7dd1a18b6637f0574aabce2e (diff)
downloadgo-git-server-4aad12ef514b43453946428f0cb937a8e0429496.tar.gz
feat: set GIT_HTTP_MAX_REQUEST_BUFFER size
-rw-r--r--internal/git/handler.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/git/handler.go b/internal/git/handler.go
index 6dc4584..7bd309a 100644
--- a/internal/git/handler.go
+++ b/internal/git/handler.go
@@ -9,6 +9,7 @@ import (
// GitHttpBackendHandler a handler for git cgi
func GitHttpBackendHandler(reposDir, backendCommand string) http.Handler {
projectDirEnv := fmt.Sprintf("GIT_PROJECT_ROOT=%v", reposDir)
+ maxBufferSize := "GIT_HTTP_MAX_REQUEST_BUFFER=100m"
return http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
ctx := req.Context()
uid := ctx.Value("urn")
@@ -19,6 +20,7 @@ func GitHttpBackendHandler(reposDir, backendCommand string) http.Handler {
Env: []string{
projectDirEnv,
fmt.Sprintf("REMOTE_USER=%s", uid),
+ maxBufferSize,
},
}
gitBackendHandler.ServeHTTP(rw, req)