[arvados] updated: 2.7.0-5457-g43b47017a9

git repository hosting git at public.arvados.org
Fri Dec 1 21:07:55 UTC 2023


Summary of changes:
 sdk/go/arvados/client.go | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

       via  43b47017a9eb5e2b427c34c12c8e2344bef6f402 (commit)
      from  03508043dde51678389860fcc7db115f83ed530c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 43b47017a9eb5e2b427c34c12c8e2344bef6f402
Author: Tom Clegg <tom at curii.com>
Date:   Fri Dec 1 16:07:31 2023 -0500

    21217: Automatically clean double-slash in API URLs.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>

diff --git a/sdk/go/arvados/client.go b/sdk/go/arvados/client.go
index eab61075e6..c2f6361334 100644
--- a/sdk/go/arvados/client.go
+++ b/sdk/go/arvados/client.go
@@ -633,7 +633,11 @@ func (c *Client) apiURL(path string) string {
 	if scheme == "" {
 		scheme = "https"
 	}
-	return scheme + "://" + c.APIHost + "/" + path
+	// Double-slash in URLs tend to cause subtle hidden problems
+	// (e.g., they can behave differently when a load balancer is
+	// in the picture). Here we ensure exactly one "/" regardless
+	// of whether the given APIHost or path has a superfluous one.
+	return scheme + "://" + strings.TrimSuffix(c.APIHost, "/") + "/" + strings.TrimPrefix(path, "/")
 }
 
 // DiscoveryDocument is the Arvados server's description of itself.

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list