Apologies if the title wording doesn't properly describe the issue, I wasn't exactly sure how to phrase it.
I am working on an API that can handle requests as though it is the S3 API, and should therefore work with the Go S3 SDK I am specifically encountering a problem when attempting to pass a Bucket name to Go S3 SDK functions.
for example:
result, err := svc.CreateBucket(&s3.CreateBucketInput{
Bucket:aws.String(bucketName),
})
when bucket name is set to a string that i believe is being parsed as two separate labels such as testBucket
or myBucket
the SDK seems to generate a request with the host address set to the endpoint address i.e. http://localhost:8000/s3/
followed by the bucket name, which my API can accept, handle, and respond appropriately.
However, when the bucket name contains a string that is parsed as a single label such as test
or bucket
or testbucket
the SDK generates a host address with the bucket name preceding the host i.e. http://test.localhost:8000/s3/
which results in an error as the API I have written does not support this host address.
Ideally I need to somehow support the use of single label bucket names, either by extending how the API handles requests, or by working out a way to force the SDK to stop changing the host URL format.
If anyone is able to help solve the issue, or offer advice I would be very grateful.