From bde24b78138df8c47b8779d45b6dbf5826136f05 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Mon, 31 Jan 2022 19:09:46 -0500 Subject: [PATCH] feat: exit session after handling git commands we don't need to worry about executing other middleware if git middleware picks up a receive/upload command --- git/git.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git/git.go b/git/git.go index 139bbd4..4faf417 100644 --- a/git/git.go +++ b/git/git.go @@ -85,6 +85,7 @@ func Middleware(repoDir string, gh Hooks) wish.Middleware { default: fatalGit(s, ErrNotAuthed) } + return case "git-upload-archive", "git-upload-pack": switch access { case ReadOnlyAccess, ReadWriteAccess, AdminAccess: @@ -100,6 +101,7 @@ func Middleware(repoDir string, gh Hooks) wish.Middleware { default: fatalGit(s, ErrNotAuthed) } + return } } sh(s)