-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method execution tests from AWS API Gateway console fail with internal error #417
Comments
When using the test capability within API Gateway, only headers added to the Headers input box (4th option from the top) are sent along. If you add anything there, such as "header: 1", this issue will go away. |
@derricksimpson I run into exactly the same issue. It would be helpful to ad that to the documentation somewhere. |
I was having the same issue. @derricksimpson Thanks for nice temporary solution! It was helpful. |
@codpot - No problem! |
@derricksimpson we can probably close this one yeah? |
The AWS API Gateway console allows you to navigate to your resource, choose "Test" and send a test request to your Lambda. When I tried this, the Lambda was throwing an error:
Yet the API worked fine when accessed from a browser.
Turning up the logging, I saw this in the logs:
Yes, it looks like
headers
is null.There are two workarounds:
serverlessExpress
function to provide a default value forheaders
:I know this is not a real-world issue, but I still wasted a fair amount of time trying to get to the bottom of it! I'm pretty sure I'm not doing anything odd in my code or deployment.
index.js
CDK
package.json
The text was updated successfully, but these errors were encountered: