File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,10 @@ const loadProbot = appFn => {
2121 return probot
2222}
2323
24+ const lowerCaseKeys = obj =>
25+ Object . keys ( obj ) . reduce ( ( accumulator , key ) =>
26+ Object . assign ( accumulator , { [ key . toLocaleLowerCase ( ) ] : obj [ key ] } ) , { } )
27+
2428module . exports . serverless = appFn => {
2529 return async ( event , context ) => {
2630 // 🤖 A friendly homepage if there isn't a payload
@@ -42,7 +46,8 @@ module.exports.serverless = appFn => {
4246 context . callbackWaitsForEmptyEventLoop = false
4347
4448 // Determine incoming webhook event type
45- const e = event . headers [ 'x-github-event' ] || event . headers [ 'X-GitHub-Event' ]
49+ const headers = lowerCaseKeys ( event . headers )
50+ const e = headers [ 'x-github-event' ]
4651
4752 // Convert the payload to an Object if API Gateway stringifies it
4853 event . body = ( typeof event . body === 'string' ) ? JSON . parse ( event . body ) : event . body
You can’t perform that action at this time.
0 commit comments