Skip to content

Commit

Permalink
fix: add body parsing for lambda edge event source
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-vendia committed Jan 15, 2021
1 parent 172069d commit 116949d
Show file tree
Hide file tree
Showing 10 changed files with 1,380 additions and 4,073 deletions.
114 changes: 95 additions & 19 deletions examples/lambda-edge/lambda-edge-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,114 @@
{
"cf": {
"config": {
"distributionId": "EXAMPLE"
"distributionDomainName": "d3qj9vk9486y6c.cloudfront.net",
"distributionId": "E2I5C7O4FEQEKZ",
"eventType": "viewer-request",
"requestId": "BKXC0kFgBfWSEgribSo9EwziZB1FztiXQ96VRvTfFNHYCBv7Ko-RBQ=="
},
"request": {
"body": {
"action": "read-only",
"data": "eyJuYW1lIjoiU2FtIn0=",
"encoding": "base64",
"inputTruncated": false
},
"clientIp": "203.123.103.37",
"headers": {
"host": [
{
"key": "Host",
"value": "d123.cf.net"
"value": "d3qj9vk9486y6c.cloudfront.net"
}
],
"user-name": [
"user-agent": [
{
"key": "User-Name",
"value": "CloudFront"
"key": "User-Agent",
"value": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
}
]
},
"clientIp": "2001:cdba::3257:9652",
"uri": "/users",
"method": "GET"
},
"response": {
"status": "200",
"statusDescription": "OK",
"headers": {
"x-cache": [
],
"content-length": [
{
"key": "content-length",
"value": "14"
}
],
"cache-control": [
{
"key": "Cache-Control",
"value": "max-age=0"
}
],
"accept": [
{
"key": "accept",
"value": "application/json,text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
}
],
"if-none-match": [
{
"key": "X-Cache",
"value": "Hello from Cloudfront"
"key": "if-none-match",
"value": "W/\"2e-Lu6qxFOQSPFulDAGUFiiK6QgREo\""
}
],
"accept-language": [
{
"key": "accept-language",
"value": "en-US,en;q=0.9"
}
],
"upgrade-insecure-requests": [
{
"key": "upgrade-insecure-requests",
"value": "1"
}
],
"content-type": [
{
"key": "content-type",
"value": "application/json"
}
],
"origin": [
{
"key": "Origin",
"value": "https://d3qj9vk9486y6c.cloudfront.net"
}
],
"sec-fetch-site": [
{
"key": "Sec-Fetch-Site",
"value": "same-origin"
}
],
"sec-fetch-mode": [
{
"key": "Sec-Fetch-Mode",
"value": "cors"
}
],
"sec-fetch-dest": [
{
"key": "Sec-Fetch-Dest",
"value": "empty"
}
],
"referer": [
{
"key": "Referer",
"value": "https://d3qj9vk9486y6c.cloudfront.net/users"
}
],
"accept-encoding": [
{
"key": "Accept-Encoding",
"value": "gzip, deflate, br"
}
]
}
},
"method": "POST",
"querystring": "",
"uri": "/users"
}
}
}
Expand Down

0 comments on commit 116949d

Please sign in to comment.