Closed philss closed 3 years ago
~I'm going to merge this. Feel free to comment and I can fix later :)~ -> I found a problem. Looks like we are not detecting correctly some places that need to receive body as binary.
@philss
how can I test this? I tried downloading latest aws-sdk-go and regenerated AWS.S3
but the payload is not interpreted as binary
@nicolae-shoreline I just found a problem with that. I'm trying to figure out what is wrong. I will ping you when I have the fix to this :)
@nicolae-shoreline the problem was in one branch of the template that handles "GET" requests. I fixed in the last commit: 60a171f
I pushed a new branch to aws-beam/aws-elixir that has the updated modules. Please give it a try: https://github.com/aws-beam/aws-elixir/tree/ps-receive-body-as-binary-generated-code
Tried with the newly generated modules and it worked:
Response from AWS.S3.get_object/22
{:ok,
%{
"Body" => <<0, 0, 0, 20, 102, 116, 121, 112, 113, 116, 32, 32, 0, 0, 0, 0,
113, 116, 32, 32, 0, 0, 0, 8, 119, 105, 100, 101, 0, 86, 224, 26, 109, 100,
97, 116, 0, 208, 64, 7, 0, 226, 155, 254, 210, 147, 96, ...>>,
"ContentLength" => "5705489",
"ContentType" => "undefined",
"ETag" => "\"dd39793ca30fd65f7e028bad4e33ce1d\"",
"LastModified" => "Thu, 25 Mar 2021 20:55:12 GMT",
"VersionId" => "VaFWtwN3rg58TF9_RGWoLLHoNJW6iAjH"
},
%{
body: <<0, 0, 0, 20, 102, 116, 121, 112, 113, 116, 32, 32, 0, 0, 0, 0, 113,
116, 32, 32, 0, 0, 0, 8, 119, 105, 100, 101, 0, 86, 224, 26, 109, 100, 97,
116, 0, 208, 64, 7, 0, 226, 155, 254, 210, 147, ...>>,
headers: [
{"x-amz-id-2",
"wEbQ15Y1A365otHaWhsMrYpwIqvaIrfoc5eXk7FYAOtOgZJDIX9+mpfmF4om7or+e0VIvVf9a4k="},
{"x-amz-request-id", "F5KD5Z0HXG5R28H8"},
{"Date", "Fri, 26 Mar 2021 21:49:26 GMT"},
{"Last-Modified", "Thu, 25 Mar 2021 20:55:12 GMT"},
{"ETag", "\"dd39793ca30fd65f7e028bad4e33ce1d\""},
{"x-amz-version-id", "VaFWtwN3rg58TF9_RGWoLLHoNJW6iAjH"},
{"Accept-Ranges", "bytes"},
{"Content-Type", "undefined"},
{"Content-Length", "5705489"},
{"Server", "AmazonS3"}
],
status_code: 200
}}
@ceolinrenato thank you for testing this! :purple_heart:
@nicolae-shoreline the problem was in one branch of the template that handles "GET" requests. I fixed in the last commit: 60a171f
I pushed a new branch to aws-beam/aws-elixir that has the updated modules. Please give it a try: https://github.com/aws-beam/aws-elixir/tree/ps-receive-body-as-binary-generated-code
yes, works for me too. thank you!
This is related to #71
This PR also includes new tests and a small refactor.