From d231fd839f0cf0ee3f5f285378213d2117d69201 Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Sat, 29 Mar 2025 12:23:19 +0800 Subject: [PATCH] add no-cache for smart-git --- proxy/gitreq.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxy/gitreq.go b/proxy/gitreq.go index 8472303..6e15e89 100644 --- a/proxy/gitreq.go +++ b/proxy/gitreq.go @@ -118,6 +118,11 @@ func GitReq(ctx context.Context, c *app.RequestContext, u string, cfg *config.Co } c.Status(resp.StatusCode) + if cfg.GitClone.Mode == "cache" { + c.Response.Header.Set("Cache-Control", "no-store, no-cache, must-revalidate") + c.Response.Header.Set("Pragma", "no-cache") + c.Response.Header.Set("Expires", "0") + } c.SetBodyStream(resp.Body, -1) //err = hwriter.Writer(resp.Body, c) /*