From a20bc9afc395be0be7defac7ce2df41f201c427d Mon Sep 17 00:00:00 2001 From: Luis GG Date: Tue, 26 Apr 2022 13:06:50 -0300 Subject: [PATCH 1/2] Update hostCompatibleBucketName doc to reflect #848 changes --- service/s3/internal/customizations/update_endpoint.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/s3/internal/customizations/update_endpoint.go b/service/s3/internal/customizations/update_endpoint.go index 209e554ef1e..a115e1def49 100644 --- a/service/s3/internal/customizations/update_endpoint.go +++ b/service/s3/internal/customizations/update_endpoint.go @@ -35,7 +35,6 @@ type UpdateEndpointParameterAccessor struct { // UpdateEndpointOptions provides the options for the UpdateEndpoint middleware setup. type UpdateEndpointOptions struct { - // Accessor are parameter accessors used by the middleware Accessor UpdateEndpointParameterAccessor @@ -256,8 +255,9 @@ func removeBucketFromPath(u *url.URL, bucket string) { } // hostCompatibleBucketName returns true if the request should -// put the bucket in the host. This is false if S3ForcePathStyle is -// explicitly set or if the bucket is not DNS compatible. +// put the bucket in the host. This is false if the bucket is not +// DNS compatible of if the client has and EndpointResolver with +// its HostnameImmutable property set to true func hostCompatibleBucketName(u *url.URL, bucket string) bool { // Bucket might be DNS compatible but dots in the hostname will fail // certificate validation, so do not use host-style. From be471e46b057701d57591e1584b7f0c0735b272a Mon Sep 17 00:00:00 2001 From: Jason Del Ponte <961963+jasdel@users.noreply.github.com> Date: Thu, 28 Apr 2022 10:36:33 -0700 Subject: [PATCH 2/2] Tweak hostCompatibleBucketName updated docs Updates the doc string for hostCompatibleBucketName adding link to the resolved Endpoint member driving the behavior. --- service/s3/internal/customizations/update_endpoint.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service/s3/internal/customizations/update_endpoint.go b/service/s3/internal/customizations/update_endpoint.go index a115e1def49..e5f95254aac 100644 --- a/service/s3/internal/customizations/update_endpoint.go +++ b/service/s3/internal/customizations/update_endpoint.go @@ -256,8 +256,10 @@ func removeBucketFromPath(u *url.URL, bucket string) { // hostCompatibleBucketName returns true if the request should // put the bucket in the host. This is false if the bucket is not -// DNS compatible of if the client has and EndpointResolver with -// its HostnameImmutable property set to true +// DNS compatible or the EndpointResolver resolves an aws.Endpoint with +// HostnameImmutable member set to true. +// +// https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws#Endpoint.HostnameImmutable func hostCompatibleBucketName(u *url.URL, bucket string) bool { // Bucket might be DNS compatible but dots in the hostname will fail // certificate validation, so do not use host-style.