From 599e808843bcbb4f2adbda864f28964e477d89c7 Mon Sep 17 00:00:00 2001 From: Reisen Usagi Date: Mon, 10 Jul 2023 20:19:30 -0300 Subject: [PATCH] Normalize path outputs emitted by the artifact server download endpoint (#1898) Co-authored-by: Casey Lee --- act/artifacts/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/act/artifacts/server.go b/act/artifacts/server.go index d0c7a6aa..daaacf66 100644 --- a/act/artifacts/server.go +++ b/act/artifacts/server.go @@ -223,9 +223,13 @@ func downloads(router *httprouter.Router, baseDir string, fsys fs.FS) { // if it was upload as gzip rel = strings.TrimSuffix(rel, gzipExtension) + path := filepath.Join(itemPath, rel) + + rel = filepath.ToSlash(rel) + path = filepath.ToSlash(path) files = append(files, ContainerItem{ - Path: filepath.Join(itemPath, rel), + Path: path, ItemType: "file", ContentLocation: fmt.Sprintf("http://%s/artifact/%s/%s/%s", req.Host, container, itemPath, rel), })