Skip to content

s3 head object, erroneously modified object name #2982

Closed as not planned
Closed as not planned
@luoyanpeng-bytedancer

Description

@luoyanpeng-bytedancer

Acknowledgements

Describe the bug

s3 head object:If the object name starts with"/+ bucket name", the SDK will remove the bucket name from the object name in the path of the URL, causing the request to return 404.

code :
s3@v1.73.2 internal/customizations/update_endpoint.go
func moveBucketNameToHost(u *url.URL, bucket string) { u.Host = bucket + "." + u.Host removeBucketFromPath(u, bucket) }

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Object names should not be modified

Current Behavior

If the object name starts with"/+ bucket name", the SDK will remove the bucket name from the object name in the path of the URL

Reproduction Steps

Head An object prefixed with "/+ bucket name"

Possible Solution

No response

Additional Information/Context

No response

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.33.0
github.com/aws/aws-sdk-go-v2/config v1.5.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.73.2
github.com/aws/smithy-go v1.22.1

Compiler and Version used

go version go1.21.7 darwin/amd64

Operating System and version

macOS 14.0 (23A344)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions