-
Notifications
You must be signed in to change notification settings - Fork 553
Open
Description
Environment
-
Elixir & Erlang versions (elixir --version):
Erlang/OTP 21 [erts-10.3.5.11] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]
Elixir 1.8.2 (compiled with Erlang/OTP 21) -
ExAws version
mix deps |grep ex_aws
2.1.3 -
HTTP client version. IE for hackney do
mix deps | grep hackney
1.15.2
Current behavior
When using ExAws.S3.list_objects_v2
or ExAws.S3.list_objects
and a key that has a space or unicode chars in it, the query params passed to S3 are double encoded.
The following command fails because the URL signatures don't match. This is because the query prefix is encoded to replace " " with +. Then the sanitize method replacces + with %2B.
ExAws.S3.list_objects_v2("my-bucket", prefix: "Copy ") |> ExAws.request()
ExAws: Request URL: "https://s3.eu-west-1.amazonaws.com/my-bucket/?list-type=2&prefix=Copy%2B"
Expected behavior
ExAws.S3.list_objects_v2("my-bucket", prefix: "Copy ") |> ExAws.request()
ExAws: Request URL: "https://s3.eu-west-1.amazonaws.com/my-bucket/?list-type=2&prefix=Copy%20"
I have a PR that shows a potential fix for this, so will include that here as well.
Metadata
Metadata
Assignees
Labels
No labels