From ef79bb284df1ab1f9d75633cec9f8cb83d1217d4 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 --- pkg/artifacts/server.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/artifacts/server.go b/pkg/artifacts/server.go index d0c7a6a..daaacf6 100644 --- a/pkg/artifacts/server.go +++ b/pkg/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), })