mirror of
https://gitea.com/gitea/runner.git
synced 2026-11-13 03:13:42 +00:00
Normalize path outputs emitted by the artifact server download endpoint (#1898)
Co-authored-by: Casey Lee <[email protected]>
This commit is contained in:
1 parent
3a0a6425a8
commit
ef79bb284d
1 file changed
+5
-1
@@ -223,9 +223,13 @@ func downloads(router *httprouter.Router, baseDir string, fsys fs.FS) {
|
|||||||
|
|
||||||
// if it was upload as gzip
|
// if it was upload as gzip
|
||||||
rel = strings.TrimSuffix(rel, gzipExtension)
|
rel = strings.TrimSuffix(rel, gzipExtension)
|
||||||
|
path := filepath.Join(itemPath, rel)
|
||||||
|
|
||||||
|
rel = filepath.ToSlash(rel)
|
||||||
|
path = filepath.ToSlash(path)
|
||||||
|
|
||||||
files = append(files, ContainerItem{
|
files = append(files, ContainerItem{
|
||||||
Path: filepath.Join(itemPath, rel),
|
Path: path,
|
||||||
ItemType: "file",
|
ItemType: "file",
|
||||||
ContentLocation: fmt.Sprintf("http://%s/artifact/%s/%s/%s", req.Host, container, itemPath, rel),
|
ContentLocation: fmt.Sprintf("http://%s/artifact/%s/%s/%s", req.Host, container, itemPath, rel),
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in new issue
Block a user