Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to API Gateway Payload 2.0 #31

Merged
merged 6 commits into from
Jan 16, 2021
Merged

Upgrade to API Gateway Payload 2.0 #31

merged 6 commits into from
Jan 16, 2021

Conversation

ofhouse
Copy link
Member

@ofhouse ofhouse commented Jan 13, 2021

ToDo

Fixes #29

Payload Examples

1.0

{
  "version": "1.0",
  "resource": "/__NEXT_PAGE_LAMBDA_0/{proxy+}",
  "path": "/__NEXT_PAGE_LAMBDA_0/test",
  "httpMethod": "GET",
  "headers": {
    "Content-Length": "0",
    "Host": "7t3jzzs4vk.execute-api.eu-central-1.amazonaws.com",
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
    "X-Amzn-Trace-Id": "Root=1-5fff599f-6fca6ee66e37fe5e518eb45b",
    "X-Forwarded-For": "84.142.29.66",
    "X-Forwarded-Port": "443",
    "X-Forwarded-Proto": "https",
    "accept": "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",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7",
    "cache-control": "max-age=0",
    "sec-ch-ua": "\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "none",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1"
  },
  "multiValueHeaders": {
    "Content-Length": [
      "0"
    ],
    "Host": [
      "7t3jzzs4vk.execute-api.eu-central-1.amazonaws.com"
    ],
    "User-Agent": [
      "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
    ],
    "X-Amzn-Trace-Id": [
      "Root=1-5fff599f-6fca6ee66e37fe5e518eb45b"
    ],
    "X-Forwarded-For": [
      "84.142.29.66"
    ],
    "X-Forwarded-Port": [
      "443"
    ],
    "X-Forwarded-Proto": [
      "https"
    ],
    "accept": [
      "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"
    ],
    "accept-encoding": [
      "gzip, deflate, br"
    ],
    "accept-language": [
      "en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7"
    ],
    "cache-control": [
      "max-age=0"
    ],
    "sec-ch-ua": [
      "\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\""
    ],
    "sec-ch-ua-mobile": [
      "?0"
    ],
    "sec-fetch-dest": [
      "document"
    ],
    "sec-fetch-mode": [
      "navigate"
    ],
    "sec-fetch-site": [
      "none"
    ],
    "sec-fetch-user": [
      "?1"
    ],
    "upgrade-insecure-requests": [
      "1"
    ]
  },
  "queryStringParameters": null,
  "multiValueQueryStringParameters": null,
  "requestContext": {
    "accountId": "161692622609",
    "apiId": "7t3jzzs4vk",
    "domainName": "7t3jzzs4vk.execute-api.eu-central-1.amazonaws.com",
    "domainPrefix": "7t3jzzs4vk",
    "extendedRequestId": "ZGrw7jKGFiAEJig=",
    "httpMethod": "GET",
    "identity": {
      "accessKey": null,
      "accountId": null,
      "caller": null,
      "cognitoAmr": null,
      "cognitoAuthenticationProvider": null,
      "cognitoAuthenticationType": null,
      "cognitoIdentityId": null,
      "cognitoIdentityPoolId": null,
      "principalOrgId": null,
      "sourceIp": "84.142.29.66",
      "user": null,
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
      "userArn": null
    },
    "path": "/__NEXT_PAGE_LAMBDA_0/test",
    "protocol": "HTTP/1.1",
    "requestId": "ZGrw7jKGFiAEJig=",
    "requestTime": "13/Jan/2021:20:35:43 +0000",
    "requestTimeEpoch": 1610570143429,
    "resourceId": "ANY /__NEXT_PAGE_LAMBDA_0/{proxy+}",
    "resourcePath": "/__NEXT_PAGE_LAMBDA_0/{proxy+}",
    "stage": "$default"
  },
  "pathParameters": {
    "proxy": "test"
  },
  "stageVariables": null,
  "body": null,
  "isBase64Encoded": false
}

2.0

{
  "version": "2.0",
  "routeKey": "ANY /__NEXT_PAGE_LAMBDA_0/{proxy+}",
  "rawPath": "/__NEXT_PAGE_LAMBDA_0/test",
  "rawQueryString": "",
  "headers": {
    "accept": "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",
    "accept-encoding": "gzip, deflate, br",
    "accept-language": "en-US,en;q=0.9,de-DE;q=0.8,de;q=0.7",
    "content-length": "0",
    "host": "7t3jzzs4vk.execute-api.eu-central-1.amazonaws.com",
    "sec-ch-ua": "\"Google Chrome\";v=\"87\", \" Not;A Brand\";v=\"99\", \"Chromium\";v=\"87\"",
    "sec-ch-ua-mobile": "?0",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "none",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1",
    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36",
    "x-amzn-trace-id": "Root=1-5fff5702-662056cc228c38b00e18933d",
    "x-forwarded-for": "84.142.29.66",
    "x-forwarded-port": "443",
    "x-forwarded-proto": "https"
  },
  "requestContext": {
    "accountId": "161692622609",
    "apiId": "7t3jzzs4vk",
    "domainName": "7t3jzzs4vk.execute-api.eu-central-1.amazonaws.com",
    "domainPrefix": "7t3jzzs4vk",
    "http": {
      "method": "GET",
      "path": "/__NEXT_PAGE_LAMBDA_0/test",
      "protocol": "HTTP/1.1",
      "sourceIp": "84.142.29.66",
      "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36"
    },
    "requestId": "ZGqIegxrliAEMig=",
    "routeKey": "ANY /__NEXT_PAGE_LAMBDA_0/{proxy+}",
    "stage": "$default",
    "time": "13/Jan/2021:20:24:34 +0000",
    "timeEpoch": 1610569474961
  },
  "pathParameters": {
    "proxy": "test"
  },
  "isBase64Encoded": false
}

@ofhouse ofhouse self-assigned this Jan 13, 2021
@ofhouse ofhouse added the feature/AWS Missing feature from AWS label Jan 13, 2021
@ofhouse ofhouse marked this pull request as ready for review January 16, 2021 14:32
@ofhouse ofhouse merged commit 3ab3c34 into main Jan 16, 2021
@ofhouse ofhouse deleted the feature/api-gateway-v2 branch January 16, 2021 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/AWS Missing feature from AWS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Internal server error when setting multiple header values
1 participant