automatically prepend a "https://" if it's missing

This commit is contained in:
nyanotech 2024-08-12 21:00:47 -07:00
parent dc1ec748df
commit 7444577cb7
Signed by: nyanotech
GPG Key ID: 872740637E938731

View File

@ -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{