From 7444577cb7c1bf4c4bd15cd405d202224d622e61 Mon Sep 17 00:00:00 2001 From: nyanotech Date: Mon, 12 Aug 2024 21:00:47 -0700 Subject: [PATCH] automatically prepend a "https://" if it's missing --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 7e81dba..5bdb346 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "context" "flag" "log" + "strings" "sync" "time" @@ -50,6 +51,10 @@ func main() { } if *endpoint != "" { + if !strings.HasPrefix(*endpoint, "http://") && !strings.HasPrefix(*endpoint, "https://") { + *endpoint = "https://" + *endpoint + } + options = append(options, config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc( func(service, region string, options ...interface{}) (aws.Endpoint, error) { return aws.Endpoint{