summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport')
-rw-r--r--rhimport/fetcher.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rhimport/fetcher.go b/rhimport/fetcher.go
index f53ed04..2ff5a9c 100644
--- a/rhimport/fetcher.go
+++ b/rhimport/fetcher.go
@@ -63,7 +63,7 @@ func curlHeaderCallback(ptr []byte, userdata interface{}) bool {
if strings.HasPrefix(hdr, "Content-Disposition:") {
if mediatype, params, err := mime.ParseMediaType(strings.TrimPrefix(hdr, "Content-Disposition:")); err == nil {
if mediatype == "attachment" {
- data.filename = data.basepath + "/" + params["filename"]
+ data.filename = filepath.Join(data.basepath, path.Clean("/"+params["filename"]))
}
}
}
@@ -74,7 +74,7 @@ func curlWriteCallback(ptr []byte, userdata interface{}) bool {
data := userdata.(*FetcherCurlCBData)
if data.file == nil {
if data.filename == "" {
- data.filename = data.basepath + "/" + data.remotename
+ data.filename = filepath.Join(data.basepath, path.Clean("/"+data.remotename))
}
fp, err := os.OpenFile(data.filename, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0600)
if err != nil {