Skip to content

Commit 90d9b8e

Browse files
committed
fix url path
1 parent 916d8cf commit 90d9b8e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

dgctl/utils/backendutils.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ import (
66
"io"
77
"mime/multipart"
88
"net/http"
9+
"net/url"
910
"os"
11+
"path"
1012
"path/filepath"
1113
)
1214

1315
func SendZipAsJobArtefact(backendUrl string, zipLocation string, jobToken string) (*int, *string, error) {
14-
url := fmt.Sprintf("%v/job_artefacts/", backendUrl)
16+
u, err := url.Parse(backendUrl)
17+
if err != nil {
18+
return nil, nil, err
19+
}
20+
u.Path = path.Join(u.Path, "job_artefacts")
21+
url := u.String()
1522
filePath := zipLocation
1623

1724
// Open the file

0 commit comments

Comments
 (0)