diff --git a/pkg/repo/repo.go b/pkg/repo/repo.go
index 5da66911e16808d386d02821e45b72ff243d0a17..74a4005771e05be264088841b409ad4a377c94e8 100644
--- a/pkg/repo/repo.go
+++ b/pkg/repo/repo.go
@@ -5,6 +5,7 @@ import (
 	"errors"
 	"fmt"
 	"io/ioutil"
+	"net/url"
 	"os"
 	"path/filepath"
 	"strings"
@@ -131,9 +132,10 @@ func (r *ChartRepository) Index() error {
 			created = time.Now().UTC().String()
 		}
 
-		url := filepath.Join(r.URL, key+".tgz")
+		url, _ := url.Parse(r.URL)
+		url.Path = filepath.Join(url.Path, key+".tgz")
 
-		entry := &ChartRef{Chartfile: *chartfile, Name: chartfile.Name, URL: url, Created: created, Checksum: hash, Removed: false}
+		entry := &ChartRef{Chartfile: *chartfile, Name: chartfile.Name, URL: url.String(), Created: created, Checksum: hash, Removed: false}
 
 		r.IndexFile.Entries[key] = entry
 
diff --git a/pkg/repo/repo_test.go b/pkg/repo/repo_test.go
index 7593d67fdc3bc8fc04b8c9f26434179af98dcc00..24a1a2c6f97e6df166a2e92e0c3d11611e573b11 100644
--- a/pkg/repo/repo_test.go
+++ b/pkg/repo/repo_test.go
@@ -90,7 +90,8 @@ func TestIndex(t *testing.T) {
 		if v.Created != created {
 			t.Errorf("Expected Created timestamp to be %s, but got %s for chart %s", created, v.Created, chart)
 		}
-		expectedURL := filepath.Join(cr.URL, chart+".tgz")
+		// Created manually since we control the input of the test
+		expectedURL := testURL + "/" + chart + ".tgz"
 		if v.URL != expectedURL {
 			t.Errorf("Expected url in entry to be %s but got %s for chart: %s", expectedURL, v.URL, chart)
 		}