fix: Ensure trailing slash in CustomEndpoint is handled gracefully

This commit is contained in:
Jack Henschel
2021-02-03 17:48:04 +02:00
parent b42d2b1f1e
commit bf02e3bacf
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -189,6 +189,11 @@ func (s3 *S3) SetEndpoint(uri string) *S3 {
if !strings.HasPrefix(uri, "http") {
uri = "https://" + uri
}
// make sure there is no trailing slash
if uri[len(uri)-1] == '/' {
uri = uri[:len(uri)-1]
}
s3.Endpoint = uri
}
return s3