mirror of
https://github.com/nyanotech/object-holder.git
synced 2026-02-08 05:47:26 -08:00
automatically prepend a "https://" if it's missing
This commit is contained in:
5
main.go
5
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{
|
||||
|
||||
Reference in New Issue
Block a user