16392: Add trailing slash to URLs like https://example in configs.
[arvados.git] / lib / config / deprecated_keepstore.go
index 401764c87add6e1e37dff63052302df34a3f5e54..186ffc3371ea6e80a80be442278fbf6b5cf596b4 100644 (file)
@@ -118,7 +118,7 @@ func (ldr *Loader) loadOldKeepstoreConfig(cfg *arvados.Config) error {
                return err
        }
 
-       myURL := arvados.URL{Scheme: "http"}
+       myURL := arvados.URL{Scheme: "http", Path: "/"}
        if oc.TLSCertificateFile != nil && oc.TLSKeyFile != nil {
                myURL.Scheme = "https"
        }
@@ -137,7 +137,7 @@ func (ldr *Loader) loadOldKeepstoreConfig(cfg *arvados.Config) error {
                cluster.TLS.Key = "file://" + *v
        }
        if v := oc.Listen; v != nil {
-               if _, ok := cluster.Services.Keepstore.InternalURLs[arvados.URL{Scheme: myURL.Scheme, Host: *v}]; ok {
+               if _, ok := cluster.Services.Keepstore.InternalURLs[arvados.URL{Scheme: myURL.Scheme, Host: *v, Path: "/"}]; ok {
                        // already listed
                        myURL.Host = *v
                } else if len(*v) > 1 && (*v)[0] == ':' {
@@ -537,6 +537,7 @@ func keepServiceURL(ks arvados.KeepService) arvados.URL {
        url := arvados.URL{
                Scheme: "http",
                Host:   net.JoinHostPort(ks.ServiceHost, strconv.Itoa(ks.ServicePort)),
+               Path:   "/",
        }
        if ks.ServiceSSLFlag {
                url.Scheme = "https"