You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across an incompatiblity between the key format of an S3Event from a trigger and the expected format s3-request-presigner GetObjectCommand expects the key to be in.
For example, If part of the key contains 'eu-west-1:77' (from a creation event)
Then the key is in the encoded format west-1%3A7 as expected.
Checkboxes for prior research
Describe the bug
I've come across an incompatiblity between the key format of an S3Event from a trigger and the expected format s3-request-presigner GetObjectCommand expects the key to be in.
For example, If part of the key contains 'eu-west-1:77' (from a creation event)
Then the key is in the encoded format west-1%3A7 as expected.
But If I then use it like so:
The presigned uri comes out like:
west-1%253A
So what's happened is that the % has now been escaped (%25) and the %3A (:) has now been corrupted.
I suspect the code should detect if the key is encoded and then run (decode|encode)URIComponent as appriopiate.
Regression Issue
SDK version number
@aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Amplify gen 2 6.6.4, Lambda - nodejs:18.v45
Reproduction Steps
Observed Behavior
The url produced is invalid
The {entity_id} key part contains a ':' which is in the S3Event s3.object.key correctly encoded
But it turns out like %253A - ie % gets escaped and the escaped : part gets corrupted.
This then presents itself as a key not found error.
Expected Behavior
I expect the GetObjectCommand to accept both decoded and encoded keys.
Possible Solution
I suspect the code should detect if the key is encoded and then run (decode|encode)URIComponent as appriopiate.
Additional Information/Context
No response
The text was updated successfully, but these errors were encountered: