You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Content-Length header automatically filled if it's not exists
AWS API Gateway doesn't pass content-length header to lambda function.
As a result of this body-parser can not parse body. This fix calculates
Content-Length with the size of body if there is no content-length
header and if there is a body.
Copy file name to clipboardExpand all lines: README.md
-6Lines changed: 0 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,9 +128,3 @@ Every contribution is very welcome. Keep these in your mind when you want to mak
128
128
2. Keep code coverage 100% with your updated tests.
129
129
3. Check your changes with a Lambda environment. You can use [SAM-CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html) to test on your local.
130
130
4. Don't forget to update documentation(this readme file) about your changes.
131
-
132
-
## Troubleshooting
133
-
134
-
### I'm making a POST request with JSON by using bodyParser as middleware but `req.body` is always `{}`
135
-
136
-
Please check your `Content-Type` and `Content-Length` request headers. For JSON requests `Content-Type` should be `application/json` and `Content-Length` should be size(in bytes) of JSON string in body.
0 commit comments