LambdaEdgeUtils
@codification/cutwater-aws > LambdaEdgeUtils
Class
beta:
Hierarchy
LambdaEdgeUtils
Methods
- isCustomOriginRequestEvent
- isCustomOriginResponseEvent
- originResponseToCloudFrontResultResponse
- stripHeaders
- stripOriginRequestHeaders
- stripOriginResponseHeaders
- stripViewerRequestHeaders
- stripViewerResponseHeaders
- toCloudFrontCustomOrigin
- toCloudFrontHeaders
- toIncomingHttpHeaders
Methods
<Static>
isCustomOriginRequestEvent
▸ isCustomOriginRequestEvent(event: CloudFrontRequestEvent
): boolean
Defined in cloudfront/LambdaEdgeUtils.ts:212
Parameters:
Name | Type |
---|---|
event | CloudFrontRequestEvent |
Returns: boolean
<Static>
isCustomOriginResponseEvent
▸ isCustomOriginResponseEvent(event: CloudFrontResponseEvent
): boolean
Defined in cloudfront/LambdaEdgeUtils.ts:217
Parameters:
Name | Type |
---|---|
event | CloudFrontResponseEvent |
Returns: boolean
<Static>
originResponseToCloudFrontResultResponse
▸ originResponseToCloudFrontResultResponse(originResponse: IncomingMessage
): Promise
<CloudFrontResultResponse
>
Defined in cloudfront/LambdaEdgeUtils.ts:180
Converts an origin's response (IncomingMessage
) to a response that can be returned to a CloudFront viewer.
Parameters:
Name | Type | Description |
---|---|---|
originResponse | IncomingMessage | the response recieved from the origin |
Returns: Promise
<CloudFrontResultResponse
>
a response to be returned to a CloudFront viewer
<Static>
stripHeaders
▸ stripHeaders(headers: CloudFrontHeaders
, headerList: string
[]): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:73
Returns a new CloudFrontHeaders
object with the specified headerList
removed.
This method also removes all headers that are black listed, as found here.
Parameters:
Name | Type | Description |
---|---|---|
headers | CloudFrontHeaders | the `CloudFrontHeaders` to be filtered |
headerList | string [] | names of the headers to be removed |
Returns: CloudFrontHeaders
a new filtered CloudFrontHeaders
object
<Static>
stripOriginRequestHeaders
▸ stripOriginRequestHeaders(headers: CloudFrontHeaders
): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:115
Returns a new CloudFrontHeaders
object with the read-only origin request headers (as specified here) removed.
This method also removes all headers that are black listed, as found here.
Parameters:
Name | Type | Description |
---|---|---|
headers | CloudFrontHeaders | the `CloudFrontHeaders` to be filtered |
Returns: CloudFrontHeaders
a new filtered CloudFrontHeaders
object
<Static>
stripOriginResponseHeaders
▸ stripOriginResponseHeaders(headers: CloudFrontHeaders
): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:149
Returns a new CloudFrontHeaders
object with the read-only origin response headers (as specified here) removed.
This method also removes all headers that are black listed, as found here.
Parameters:
Name | Type | Description |
---|---|---|
headers | CloudFrontHeaders | the `CloudFrontHeaders` to be filtered |
Returns: CloudFrontHeaders
a new filtered CloudFrontHeaders
object
<Static>
stripViewerRequestHeaders
▸ stripViewerRequestHeaders(headers: CloudFrontHeaders
): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:98
Returns a new CloudFrontHeaders
object with the read-only viewer request headers (as specified here) removed.
This method also removes all headers that are black listed, as found here.
Parameters:
Name | Type | Description |
---|---|---|
headers | CloudFrontHeaders | the `CloudFrontHeaders` to be filtered |
Returns: CloudFrontHeaders
a new filtered CloudFrontHeaders
object
<Static>
stripViewerResponseHeaders
▸ stripViewerResponseHeaders(headers: CloudFrontHeaders
): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:132
Returns a new CloudFrontHeaders
object with the read-only viewer response headers (as specified here) removed.
This method also removes all headers that are black listed, as found here.
Parameters:
Name | Type | Description |
---|---|---|
headers | CloudFrontHeaders | the `CloudFrontHeaders` to be filtered |
Returns: CloudFrontHeaders
a new filtered CloudFrontHeaders
object
<Static>
toCloudFrontCustomOrigin
▸ toCloudFrontCustomOrigin(request: CloudFrontRequest
): CloudFrontCustomOrigin
Defined in cloudfront/LambdaEdgeUtils.ts:204
Parameters:
Name | Type |
---|---|
request | CloudFrontRequest |
Returns: CloudFrontCustomOrigin
<Static>
toCloudFrontHeaders
▸ toCloudFrontHeaders(headers: IncomingHttpHeaders
): CloudFrontHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:159
Converts CloudFrontHeaders
to IncomingHttpHeaders
provided by node.
Parameters:
Name | Type | Description |
---|---|---|
headers | IncomingHttpHeaders | the headers from CloudFront to be converted |
Returns: CloudFrontHeaders
the converted headers
<Static>
toIncomingHttpHeaders
▸ toIncomingHttpHeaders(headers?: CloudFrontHeaders
): IncomingHttpHeaders
Defined in cloudfront/LambdaEdgeUtils.ts:222
Parameters:
Name | Type |
---|---|
Optional headers | CloudFrontHeaders |
Returns: IncomingHttpHeaders