From 941399795ec51345fa24c0887fe8b4b0321ccdac Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 8 Jun 2020 21:30:36 -0700 Subject: [PATCH] bin/git-http-backend-verify: include bundle filename hint Add a "Content-Disposition: attachment; filename=" header to hint to the client what the intended filename should be. Now when using curl's -J option, something like this: curl -JLO https://repo.or.cz/girocco.git/clone.bundle will end up fetching the current "girocco-XXXXXXXX.bundle" file rather than fetching a file called, unhelpfully, "clone.bundle". Signed-off-by: Kyle J. McKay --- bin/git-http-backend-verify | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/git-http-backend-verify b/bin/git-http-backend-verify index 39ebf49..ba19dd3 100755 --- a/bin/git-http-backend-verify +++ b/bin/git-http-backend-verify @@ -334,8 +334,8 @@ if [ -n "$bundle" ]; then [ -f "$bundlehdr" ] && [ -f "$bundlepck" ] || { notfound; exit 0; } [ -s "$bundlehdr" ] || [ -s "$bundlepck" ] || { notfound; exit 0; } [ -z "$isredir" ] || { redir "/$proj/$linked.bundle"; exit 0; } - exec "$cfg_basedir/bin/rangecgi" -c 'application/x-git-bundle' -e 180 \ - -m 1 "$bundlehdr" "$bundlepck" + exec "$cfg_basedir/bin/rangecgi" -c 'application/x-git-bundle' \ + -f "$suffix" -e 180 -m 1 "$bundlehdr" "$bundlepck" internalerr "exec failed: $cfg_basedir/bin/rangecgi" exit 1 fi -- 2.11.4.GIT