Skip to content

Commit

Permalink
feat(minimalEvent): also set content-type header
Browse files Browse the repository at this point in the history
  • Loading branch information
NamesMT committed Sep 4, 2024
1 parent be3ae84 commit 0402ec4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/utils/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export function minimalEvent(method: string, path: string, baseEvent?: APIGatewa
routeKey: '',
}

event.headers ??= {}
event.headers['content-type'] ??= 'application/json'

event.routeKey = event.requestContext.routeKey = `${method} ${path}`
event.requestContext.http.method = method
event.rawPath = event.requestContext.http.path = path
Expand Down

0 comments on commit 0402ec4

Please sign in to comment.