[lxc-devel] [lxd/master] simplestreams: Drop duplicated slash

geaaru on Github lxc-bot at linuxcontainers.org
Mon Jan 4 12:12:59 UTC 2021


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 420 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20210104/40fed6ae/attachment.bin>
-------------- next part --------------
From e44862532a416041ac6818f197e75f1205319580 Mon Sep 17 00:00:00 2001
From: Daniele Rondina <geaaru at sabayonlinux.org>
Date: Mon, 4 Jan 2021 13:10:14 +0100
Subject: [PATCH] simplestreams: Drop duplicated slash

Signed-off-by: Daniele Rondina <geaaru at sabayonlinux.org>
---
 shared/simplestreams/simplestreams.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/shared/simplestreams/simplestreams.go b/shared/simplestreams/simplestreams.go
index 4d623f6eb2..a459eaac00 100644
--- a/shared/simplestreams/simplestreams.go
+++ b/shared/simplestreams/simplestreams.go
@@ -98,7 +98,7 @@ func (s *SimpleStreams) cachedDownload(path string) ([]byte, error) {
 	}
 
 	// Download from the source
-	uri := fmt.Sprintf("%s/%s", s.url, path)
+	uri := fmt.Sprintf("%s/%s", strings.TrimRight(s.url, "/"), strings.TrimLeft(path, "/"))
 	req, err := http.NewRequest("GET", uri, nil)
 	if err != nil {
 		return nil, err


More information about the lxc-devel mailing list