aws-sdk-go-v2
aws-sdk-go-v2 copied to clipboard
Update presign post URL resolution to use the exact result from EndpointResolverV2
- Update presign post URL resolution to use the exact result from EndpointResolverV2
Fixes #2827
Discussed offline. Our original approach was to update toBaseURL to fix this edge case. However, this had the pitfall of being hard to capture all corner cases. Instead of coming up with a heuristic to figure out how to best parse the URL from the bucket, use the URI directly from endpointResolverV2. This change does this by:
- Adds a new code generator that has a
renderPostEndpointResolutionHook, which generates the line onendpoints.goto store the URI on the context - PresigPost uses this value instead of getting the URL from the request object
Tests are copied from a draft PR with the 1st approach
Testing
- Ran all unit tests for presign_post_test
- Ran integration tests manually (although we don't need this now since they are run by default 🎉 )