Sha256: e476e9d6a26cdd5f1ee5d3acdd6105457331463ff0df16f9a4373ab942b0900d

Contents?: true

Size: 603 Bytes

Versions: 16

Compression:

Stored size: 603 Bytes

Contents

package customizations

import (
	"github.com/aws/smithy-go/transport/http"
	"strings"
)

func updateS3HostForS3AccessPoint(req *http.Request) {
	updateHostPrefix(req, "s3", s3AccessPoint)
}

func updateS3HostForS3ObjectLambda(req *http.Request) {
	updateHostPrefix(req, "s3", s3ObjectLambda)
}

func updateHostPrefix(req *http.Request, oldEndpointPrefix, newEndpointPrefix string) {
	host := req.URL.Host
	if strings.HasPrefix(host, oldEndpointPrefix) {
		// For example if oldEndpointPrefix=s3 would replace to newEndpointPrefix
		req.URL.Host = newEndpointPrefix + host[len(oldEndpointPrefix):]
	}
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ruby_snowflake_client-1.3.7 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.6 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.5 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.4 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.4.pre.debug ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.3.pre.debug ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.2 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.1 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.3.0 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.2.1 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.2.0 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.1.1 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.1.0 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.0.2 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.0.1 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go
ruby_snowflake_client-1.0.0 ext/vendor/github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations/host.go