diff --git a/pkg/web/git.go b/pkg/web/git.go index 1980f73af53cda7ff1b594fd4581d7397de0b0f2..91e4d6e2fe97b5e91ef2bf0d7a37238af368d7cf 100644 --- a/pkg/web/git.go +++ b/pkg/web/git.go @@ -124,7 +124,7 @@ var gitRoutes = []GitRoute{ { method: []string{http.MethodPost}, handler: serviceRpc, - path: "/{service:(?:git-upload-pack|git-receive-pack)$}", + path: "/{service:(?:git-upload-archive|git-upload-pack|git-receive-pack)$}", }, { method: []string{http.MethodGet}, @@ -274,7 +274,7 @@ func withAccess(next http.Handler) http.HandlerFunc { } fallthrough - case service == git.UploadPackService: + case service == git.UploadPackService || service == git.UploadArchiveService: if repo == nil { // If the repo doesn't exist, return 404 renderNotFound(w, r) @@ -394,7 +394,11 @@ func serviceRpc(w http.ResponseWriter, r *http.Request) { cmd := git.ServiceCommand{ Stdout: &stdout, Dir: dir, - Args: []string{"--stateless-rpc"}, + } + + switch service { + case git.UploadPackService, git.ReceivePackService: + cmd.Args = append(cmd.Args, "--stateless-rpc") } user := proto.UserFromContext(ctx)