GetObject result.ContentLength different from Response Content #2525
-
Describe the bugs3 Content Length and go-sdk's ContentLength is different. This causes our endpoints which were streaming data to fail. This has started happening after we did upgrades mentioned here #2370 Expected BehaviorContent length should be same as received by the Http call in Debug logs Current BehaviorActual ContentLength : 25676 Reproduction StepsPlease refer https://github.com/gautampunhani/aws-sdk-content-length-issue/tree/main , Which tries to access an AWS Open Data S3 file. Possible SolutionNo response Additional Information/ContextNo response AWS Go SDK V2 Module Versions UsedPlease refer here for versions used : https://github.com/gautampunhani/aws-sdk-content-length-issue/blob/main/go.mod Compiler and Version usedgo version go1.21.3 Operating System and versiondarwin/amd64 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @gautampunhani, Thanks for reaching out.
fmt.Printf("\n\nContent Length %d", out.ContentLength) Instead, you need to dereference it: fmt.Printf("\n\nContent Length %d", *out.ContentLength) Thanks, |
Beta Was this translation helpful? Give feedback.
Hi @gautampunhani,
Thanks for reaching out.
I don't think this has anything to do with #2370.
response.ContentLength
is a *int64.In your code you are printing the pointer of content length:
Instead, you need to dereference it:
Thanks,
Ran~