Skip to content

Commit bdfa92e

Browse files
committed
chore: log event
1 parent 4815e22 commit bdfa92e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/templates/getHandler.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const makeHandler =
5555

5656
return async (event, context) => {
5757
let requestMode = mode
58+
const ev = JSON.stringify(event)
5859
// Ensure that paths are encoded - but don't double-encode them
5960
event.path = new URL(event.path, event.rawUrl).pathname
6061
// Next expects to be able to parse the query from the URL
@@ -92,6 +93,8 @@ const makeHandler =
9293
}
9394
multiValueHeaders['cache-control'] = ['public, max-age=0, must-revalidate']
9495
}
96+
multiValueHeaders['x-event'] = [ev]
97+
multiValueHeaders['x-path'] = [event.path]
9598
multiValueHeaders['x-render-mode'] = [requestMode]
9699
return {
97100
...result,

0 commit comments

Comments
 (0)