Merge pull request #9822 from sathieu/fix_helm_dep_build_encoded_url

Fix encoded path for 'helm dependency build'
pull/9707/head
Matt Farina 3 years ago committed by GitHub
commit 387b0b74d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -802,6 +802,7 @@ func normalizeURL(baseURL, urlOrPath string) (string, error) {
return urlOrPath, errors.Wrap(err, "base URL failed to parse")
}
u2.RawPath = path.Join(u2.RawPath, urlOrPath)
u2.Path = path.Join(u2.Path, urlOrPath)
return u2.String(), nil
}

@ -55,6 +55,7 @@ func TestNormalizeURL(t *testing.T) {
}{
{name: "basic URL", base: "https://example.com", path: "http://helm.sh/foo", expect: "http://helm.sh/foo"},
{name: "relative path", base: "https://helm.sh/charts", path: "foo", expect: "https://helm.sh/charts/foo"},
{name: "Encoded path", base: "https://helm.sh/a%2Fb/charts", path: "foo", expect: "https://helm.sh/a%2Fb/charts/foo"},
}
for _, tt := range tests {

Loading…
Cancel
Save