1
0
Fork 0
mirror of https://code.forgejo.org/forgejo/runner.git synced 2025-09-15 18:57:01 +00:00

Normalize path outputs emitted by the artifact server download endpoint (#1898)

Co-authored-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
Reisen Usagi 2023-07-10 20:19:30 -03:00 committed by GitHub
parent a2b862a830
commit 599e808843

View file

@ -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),
})