Cutwater

Cutwater

  • Docs
  • Help
  • GitHub

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:

NameType
eventCloudFrontRequestEvent

Returns: boolean


<Static> isCustomOriginResponseEvent

▸ isCustomOriginResponseEvent(event: CloudFrontResponseEvent): boolean

Defined in cloudfront/LambdaEdgeUtils.ts:217

Parameters:

NameType
eventCloudFrontResponseEvent

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:

NameTypeDescription
originResponseIncomingMessagethe 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:

NameTypeDescription
headersCloudFrontHeadersthe `CloudFrontHeaders` to be filtered
headerListstring[]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:

NameTypeDescription
headersCloudFrontHeadersthe `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:

NameTypeDescription
headersCloudFrontHeadersthe `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:

NameTypeDescription
headersCloudFrontHeadersthe `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:

NameTypeDescription
headersCloudFrontHeadersthe `CloudFrontHeaders` to be filtered

Returns: CloudFrontHeaders a new filtered CloudFrontHeaders object


<Static> toCloudFrontCustomOrigin

▸ toCloudFrontCustomOrigin(request: CloudFrontRequest): CloudFrontCustomOrigin

Defined in cloudfront/LambdaEdgeUtils.ts:204

Parameters:

NameType
requestCloudFrontRequest

Returns: CloudFrontCustomOrigin


<Static> toCloudFrontHeaders

▸ toCloudFrontHeaders(headers: IncomingHttpHeaders): CloudFrontHeaders

Defined in cloudfront/LambdaEdgeUtils.ts:159

Converts CloudFrontHeaders to IncomingHttpHeaders provided by node.

Parameters:

NameTypeDescription
headersIncomingHttpHeadersthe headers from CloudFront to be converted

Returns: CloudFrontHeaders the converted headers


<Static> toIncomingHttpHeaders

▸ toIncomingHttpHeaders(headers?: CloudFrontHeaders): IncomingHttpHeaders

Defined in cloudfront/LambdaEdgeUtils.ts:222

Parameters:

NameType
Optional headersCloudFrontHeaders

Returns: IncomingHttpHeaders


  • Class
  • Hierarchy
    • Methods
  • Methods
    • `` isCustomOriginRequestEvent
    • `` isCustomOriginResponseEvent
    • `` originResponseToCloudFrontResultResponse
    • `` stripHeaders
    • `` stripOriginRequestHeaders
    • `` stripOriginResponseHeaders
    • `` stripViewerRequestHeaders
    • `` stripViewerResponseHeaders
    • `` toCloudFrontCustomOrigin
    • `` toCloudFrontHeaders
    • `` toIncomingHttpHeaders
Cutwater
Docs
Getting Started
Community
Stack Overflow
More
GitHubStar
Copyright © 2019 Codification.org