mirror of
https://github.com/nyanotech/object-holder.git
synced 2025-12-16 11:30:24 -08:00
automatically prepend a "https://" if it's missing
This commit is contained in:
parent
dc1ec748df
commit
7444577cb7
5
main.go
5
main.go
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"flag"
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -50,6 +51,10 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if *endpoint != "" {
|
if *endpoint != "" {
|
||||||
|
if !strings.HasPrefix(*endpoint, "http://") && !strings.HasPrefix(*endpoint, "https://") {
|
||||||
|
*endpoint = "https://" + *endpoint
|
||||||
|
}
|
||||||
|
|
||||||
options = append(options, config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(
|
options = append(options, config.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(
|
||||||
func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
func(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||||
return aws.Endpoint{
|
return aws.Endpoint{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user