diff options
Diffstat (limited to 'internal/util')
| -rw-r--r-- | internal/util/util.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/util/util.go b/internal/util/util.go index f9e2f7b..a8abd80 100644 --- a/internal/util/util.go +++ b/internal/util/util.go @@ -5,6 +5,7 @@ import ( "fmt" "net/url" "os" + "path" "strings" "time" @@ -23,6 +24,11 @@ func EnsureValidURL(s string) (string, error) { if parsedURL.Scheme == "" { parsedURL.Scheme = "https" } + if parsedURL.Path != "" { + // Clean the path + // https://pkg.go.dev/path#Clean + parsedURL.Path = path.Clean(parsedURL.Path) + } return parsedURL.String(), nil } |
