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
It's a difference in behavior between serverless-offline and real AWS APIGateway V2 aka events.httpApi.
Expected Behavior
event.headers.content-type property is lowercased even if it's passed by curl as cOnteNt-type: , because AWS lowercases it.
Current Behavior
event.headers.content-type arrives the same way an HTTP client passed it. E.g. curl --no-progress-meter -X POST -d '{ "code": 2}' -H 'Content-type: application/json' would be capitalized in the event object.
By contrast, AWS always normalizes it to lowercase content-type.
I'm not aware whether http or headers other than content-type are affected too
Sample Code
It works in the aws-nodejs template, with http replaced by httpApi. I can provide with a repo should a need arise, but it's really simple.
The text was updated successfully, but these errors were encountered:
nponeccop
added a commit
to nponeccop/serverless-openapi-templates
that referenced
this issue
Apr 6, 2021
Bug Report
It's a difference in behavior between
serverless-offline
and real AWS APIGateway V2 akaevents.httpApi
.Expected Behavior
event.headers.content-type
property is lowercased even if it's passed bycurl
ascOnteNt-type:
, because AWS lowercases it.Current Behavior
event.headers.content-type
arrives the same way an HTTP client passed it. E.g.curl --no-progress-meter -X POST -d '{ "code": 2}' -H 'Content-type: application/json'
would be capitalized in theevent
object.By contrast, AWS always normalizes it to lowercase
content-type
.I'm not aware whether
http
or headers other thancontent-type
are affected tooSample Code
It works in the
aws-nodejs
template, withhttp
replaced byhttpApi
. I can provide with a repo should a need arise, but it's really simple.The text was updated successfully, but these errors were encountered: