cmd/uplink: properly path escape shares

Fixes #3829

Change-Id: I0f900a392239fcc064cea968fc7a5bc373ee26a1
This commit is contained in:
Jeff Wendling 2020-04-30 16:56:39 -06:00 committed by JT Olio
parent 31b322f07e
commit f93d764998

View File

@ -6,6 +6,7 @@ package cmd
import (
"fmt"
"io/ioutil"
"net/url"
"path/filepath"
"strings"
"time"
@ -149,10 +150,14 @@ func shareMain(cmd *cobra.Command, args []string) (err error) {
if err != nil {
return err
}
fmt.Println("URL :", fmt.Sprintf("%s/%s/%s/%s", shareCfg.BaseURL, newAccessData, p.Bucket(), p.Path()))
fmt.Println("URL :", fmt.Sprintf("%s/%s/%s/%s", shareCfg.BaseURL,
url.PathEscape(newAccessData),
url.PathEscape(p.Bucket()),
url.PathEscape(p.Path())))
} else {
fmt.Println("=========== BROWSER URL PREFIX ===========================================================")
fmt.Println("URL :", fmt.Sprintf("%s/%s", shareCfg.BaseURL, newAccessData))
fmt.Println("URL :", fmt.Sprintf("%s/%s", shareCfg.BaseURL,
url.PathEscape(newAccessData)))
}
if shareCfg.ExportTo != "" {