diff --git a/act/artifactcache/handler.go b/act/artifactcache/handler.go index c02c450c..013c642b 100644 --- a/act/artifactcache/handler.go +++ b/act/artifactcache/handler.go @@ -199,9 +199,10 @@ func (h *Handler) find(w http.ResponseWriter, r *http.Request, params httprouter h.responseJSON(w, r, 204) return } + archiveLocation := fmt.Sprintf("%s/%s%s/artifacts/%d", r.Header.Get("Forgejo-Cache-Host"), r.Header.Get("Forgejo-Cache-RunId"), urlBase, cache.ID) h.responseJSON(w, r, 200, map[string]any{ "result": "hit", - "archiveLocation": fmt.Sprintf("%s%s/artifacts/%d", h.ExternalURL(), urlBase, cache.ID), + "archiveLocation": archiveLocation, "cacheKey": cache.Key, }) } diff --git a/act/cacheproxy/handler.go b/act/cacheproxy/handler.go index efb67f4e..42d58d6b 100644 --- a/act/cacheproxy/handler.go +++ b/act/cacheproxy/handler.go @@ -151,8 +151,10 @@ func (h *Handler) newReverseProxy(targetHost string) (*httputil.ReverseProxy, er r.Out.Header.Add("Forgejo-Cache-Repo", runData.RepositoryFullName) r.Out.Header.Add("Forgejo-Cache-RunNumber", runData.RunNumber) + r.Out.Header.Add("Forgejo-Cache-RunId", id) r.Out.Header.Add("Forgejo-Cache-Timestamp", runData.Timestamp) r.Out.Header.Add("Forgejo-Cache-MAC", runData.RepositoryMAC) + r.Out.Header.Add("Forgejo-Cache-Host", h.ExternalURL()) }, } return proxy, nil