Skip to content

Commit 228ad65

Browse files
authored
fix: allow downloading S3 files from MinIO over http (#570)
* fix: allow downloading S3 files from MinIO over http * validate scheme, enforce https by default
1 parent 5cb8b18 commit 228ad65

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

get_s3.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,11 @@ func (g *S3Getter) newS3Client(
372372
opts.UsePathStyle = true
373373
// If it's not an AWS domain, set the custom endpoint
374374
if !isAWSDomain {
375-
opts.BaseEndpoint = aws.String("https://" + url.Host)
375+
scheme := url.Scheme
376+
if scheme == "" {
377+
scheme = "https"
378+
}
379+
opts.BaseEndpoint = aws.String(scheme + "://" + url.Host)
376380
}
377381
}
378382

0 commit comments

Comments
 (0)