lambci / docker-lambda

Docker images and test runners that replicate the live AWS Lambda environment
MIT License
5.83k stars 431 forks source link

Body passed by the custom runtime either incorrectly parsed or ignored #181

Closed FieryCod closed 5 years ago

FieryCod commented 5 years ago

Dear docker-lambda developers,

I'm trying to send a following response by using provided runtime, but either the payload is ignored or it's incorrectly parsed (or it's my fault :)).

Anyway that's my payload

"{\"body\": \"hello\",
  \"statusCode\": 200, 
  \"headers\": {},
  \"isBase64Encoded\": false}"

The result of sending payload is that the runtime hangs for a while and then after timeout I receive the response from the post request which indicates that the request was successful.

{"status" OK}, status 202

But I still get the "Internal Server Error" in the browser after the timeout and not actual payload.

Steps to reproduce:

  1. Clone the repo https://github.com/FieryCod/holy-lambda
  2. Run make (You will need leiningen and npm to make it work)
  3. cd examples/hello-lambda
  4. make install-holy-lambda compile native-compile native-dry-api

:face_with_head_bandage: As always it was an issue with my code!