From f63c4d06040ebc160a156d4d38c90dbd7c4f0217 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 05 May 2026 13:59:45 +0000 Subject: [PATCH] appview/git_http: replace proxy with redirects hopefully this can improve error handling in clones Signed-off-by: oppiliappan --- appview/state/git_http.go | 13 ++++--------- 1 file(s) changed, 4 insertion(s)(+), 9 deletion(s)(-) diff --git a/appview/state/git_http.go b/appview/state/git_http.go --- a/appview/state/git_http.go +++ b/appview/state/git_http.go @@ -46,17 +46,12 @@ } service := r.URL.Query().Get("service") - var contentType string - switch service { - case "git-receive-pack": - contentType = "application/x-git-receive-pack-advertisement" - default: - contentType = "application/x-git-upload-pack-advertisement" + if service != "git-receive-pack" { go s.notifier.Clone(context.Background(), repo) } targetURL := fmt.Sprintf("%s://%s/%s/info/refs?%s", scheme, repo.Knot, repo.RepoIdentifier(), r.URL.RawQuery) - s.proxyRequest(w, r, targetURL, contentType) + http.Redirect(w, r, targetURL, http.StatusTemporaryRedirect) } func (s *State) UploadArchive(w http.ResponseWriter, r *http.Request) { @@ -68,7 +63,7 @@ } targetURL := fmt.Sprintf("%s://%s/%s/git-upload-archive?%s", scheme, repo.Knot, repo.RepoIdentifier(), r.URL.RawQuery) - s.proxyRequest(w, r, targetURL, "application/x-git-upload-archive-result") + http.Redirect(w, r, targetURL, http.StatusTemporaryRedirect) } func (s *State) UploadPack(w http.ResponseWriter, r *http.Request) { @@ -80,7 +75,7 @@ } targetURL := fmt.Sprintf("%s://%s/%s/git-upload-pack?%s", scheme, repo.Knot, repo.RepoIdentifier(), r.URL.RawQuery) - s.proxyRequest(w, r, targetURL, "application/x-git-upload-pack-result") + http.Redirect(w, r, targetURL, http.StatusTemporaryRedirect) } func (s *State) ReceivePack(w http.ResponseWriter, r *http.Request) { -- tangled.sh