Revert "removes the wrong assumption that headers are alkways set (#40876)" (#40929)

This reverts commit 48addad317.
This commit is contained in:
Simon Buchan 2019-12-13 23:56:09 +13:00 committed by Orta
parent 2c98773426
commit 03d285dfdc
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ strOrUndefined = apiGwEvtReqCtx.routeKey;
/* API Gateway Event */
strOrNull = apiGwEvt.body;
str = apiGwEvt.headers!['example'];
str = apiGwEvt.headers['example'];
str = apiGwEvt.multiValueHeaders['example'][0];
str = apiGwEvt.httpMethod;
bool = apiGwEvt.isBase64Encoded;

View File

@ -79,7 +79,7 @@ export interface APIGatewayEventRequestContext {
// API Gateway "event"
export interface APIGatewayProxyEvent {
body: string | null;
headers?: { [name: string]: string };
headers: { [name: string]: string };
multiValueHeaders: { [name: string]: string[] };
httpMethod: string;
isBase64Encoded: boolean;