ws-response
: Invalid request.response
given to API Gateway
#1219
Labels
ws-response
: Invalid request.response
given to API Gateway
#1219
Description
At the end of
ws-response
middleware, we setrequest.response.statusCode
to200
, so API Gateway knows that everything went well.However, it actually wants an object containing ONLY statusCode. Otherwise, it will send an Internal Error message to the client.
Example:
In my lambda:
Here is the content of
request.response
at the end of the middleware:{ ConnectionId: 'ZmDx-dJ4FiACFkQ=', Data: '"Hello"', statusCode: 200 }
I receive the following error message on the client:
Fix:
Replace line 42 by:
By doing this, with the same lambda code, I receive the following message on the client:
Environment:
The text was updated successfully, but these errors were encountered: