mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
[aws-lambda] Add protocol to APIGatewayRequestContext. (#42419)
Fixes #42049. No decent docs from AWS for the actual proxy integration, on the Lambda side or the API Gateway side, but there's an approximation on the API Gateway docs for the VTL $context variable: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html#context-variable-reference From experimentation, not all of the variables referenced above exist, at least most of the time, but everything except the `protocol` that was present in what I received already existed.
This commit is contained in:
+1
@@ -9,6 +9,7 @@ export interface APIGatewayEventRequestContext {
|
||||
domainPrefix?: string;
|
||||
eventType?: string;
|
||||
extendedRequestId?: string;
|
||||
protocol: string;
|
||||
httpMethod: string;
|
||||
identity: APIGatewayEventIdentity;
|
||||
messageDirection?: string;
|
||||
|
||||
@@ -28,6 +28,7 @@ let proxyHandler: APIGatewayProxyHandler = async (event, context, callback) => {
|
||||
requestContext = event.requestContext;
|
||||
str = event.resource;
|
||||
|
||||
str = requestContext.protocol;
|
||||
str = requestContext.accountId;
|
||||
str = requestContext.apiId;
|
||||
const authContext: AuthResponseContext | null | undefined = requestContext.authorizer;
|
||||
|
||||
Reference in New Issue
Block a user