Add support for S3 path style URLS.

This commit is contained in:
nrew225
2019-07-21 09:01:02 -05:00
parent 58edf68fd7
commit 6cb2de3cff
4 changed files with 18 additions and 12 deletions

View File

@ -25,7 +25,6 @@ THE SOFTWARE.
package server
import (
"github.com/aws/aws-sdk-go/aws/credentials"
"math"
"net/http"
"net/mail"
@ -33,15 +32,17 @@ import (
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/golang/gddo/httputil/header"
)
func getAwsSession(accessKey, secretKey, region, endpoint string) *session.Session {
func getAwsSession(accessKey, secretKey, region, endpoint string, forcePathStyle bool) *session.Session {
return session.Must(session.NewSession(&aws.Config{
Region: aws.String(region),
Endpoint: aws.String(endpoint),
Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""),
Region: aws.String(region),
Endpoint: aws.String(endpoint),
Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""),
S3ForcePathStyle: aws.Bool(forcePathStyle),
}))
}