@aligent/cdk-prerender-proxy 0.2.5-experimental2 → 0.2.5-experimental5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/lib/error-response-construct.js +1 -1
  2. package/lib/handlers/cache-control.ts +3 -20
  3. package/lib/handlers/error-response.ts +3 -50
  4. package/lib/handlers/package-lock.json +1257 -40
  5. package/lib/handlers/package.json +7 -3
  6. package/lib/handlers/prerender-check.ts +3 -26
  7. package/lib/handlers/prerender.ts +3 -42
  8. package/lib/handlers/tsconfig.json +1 -4
  9. package/lib/prerender-cf-cache-control-construct.js +1 -1
  10. package/lib/prerender-check-construct.js +1 -1
  11. package/lib/prerender-construct.js +1 -1
  12. package/package.json +6 -4
  13. package/lib/handlers/node_modules/.package-lock.json +0 -55
  14. package/lib/handlers/node_modules/@types/aws-lambda/LICENSE +0 -21
  15. package/lib/handlers/node_modules/@types/aws-lambda/README.md +0 -16
  16. package/lib/handlers/node_modules/@types/aws-lambda/common/api-gateway.d.ts +0 -79
  17. package/lib/handlers/node_modules/@types/aws-lambda/common/cloudfront.d.ts +0 -79
  18. package/lib/handlers/node_modules/@types/aws-lambda/handler.d.ts +0 -171
  19. package/lib/handlers/node_modules/@types/aws-lambda/index.d.ts +0 -85
  20. package/lib/handlers/node_modules/@types/aws-lambda/package.json +0 -210
  21. package/lib/handlers/node_modules/@types/aws-lambda/trigger/alb.d.ts +0 -48
  22. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-authorizer.d.ts +0 -174
  23. package/lib/handlers/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts +0 -187
  24. package/lib/handlers/node_modules/@types/aws-lambda/trigger/appsync-resolver.d.ts +0 -51
  25. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudformation-custom-resource.d.ts +0 -68
  26. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-request.d.ts +0 -20
  27. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudfront-response.d.ts +0 -21
  28. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-events.d.ts +0 -8
  29. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cloudwatch-logs.d.ts +0 -37
  30. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codebuild-cloudwatch-state.d.ts +0 -104
  31. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-action.d.ts +0 -31
  32. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-pipeline.d.ts +0 -32
  33. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch-stage.d.ts +0 -23
  34. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline-cloudwatch.d.ts +0 -11
  35. package/lib/handlers/node_modules/@types/aws-lambda/trigger/codepipeline.d.ts +0 -55
  36. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/_common.d.ts +0 -41
  37. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/create-auth-challenge.d.ts +0 -22
  38. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-email-sender.d.ts +0 -86
  39. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/custom-message.d.ts +0 -44
  40. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/define-auth-challenge.d.ts +0 -21
  41. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/index.d.ts +0 -119
  42. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-authentication.d.ts +0 -15
  43. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/post-confirmation.d.ts +0 -22
  44. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-authentication.d.ts +0 -15
  45. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-signup.d.ts +0 -31
  46. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/pre-token-generation.d.ts +0 -45
  47. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/user-migration.d.ts +0 -39
  48. package/lib/handlers/node_modules/@types/aws-lambda/trigger/cognito-user-pool-trigger/verify-auth-challenge-response.d.ts +0 -20
  49. package/lib/handlers/node_modules/@types/aws-lambda/trigger/connect-contact-flow.d.ts +0 -65
  50. package/lib/handlers/node_modules/@types/aws-lambda/trigger/dynamodb-stream.d.ts +0 -45
  51. package/lib/handlers/node_modules/@types/aws-lambda/trigger/eventbridge.d.ts +0 -18
  52. package/lib/handlers/node_modules/@types/aws-lambda/trigger/iot.d.ts +0 -28
  53. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-firehose-transformation.d.ts +0 -45
  54. package/lib/handlers/node_modules/@types/aws-lambda/trigger/kinesis-stream.d.ts +0 -28
  55. package/lib/handlers/node_modules/@types/aws-lambda/trigger/lex.d.ts +0 -116
  56. package/lib/handlers/node_modules/@types/aws-lambda/trigger/msk.d.ts +0 -21
  57. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3-batch.d.ts +0 -41
  58. package/lib/handlers/node_modules/@types/aws-lambda/trigger/s3.d.ts +0 -60
  59. package/lib/handlers/node_modules/@types/aws-lambda/trigger/ses.d.ts +0 -103
  60. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sns.d.ts +0 -38
  61. package/lib/handlers/node_modules/@types/aws-lambda/trigger/sqs.d.ts +0 -46
  62. package/lib/handlers/node_modules/@types/node/LICENSE +0 -21
  63. package/lib/handlers/node_modules/@types/node/README.md +0 -16
  64. package/lib/handlers/node_modules/@types/node/assert/strict.d.ts +0 -4
  65. package/lib/handlers/node_modules/@types/node/assert.d.ts +0 -124
  66. package/lib/handlers/node_modules/@types/node/async_hooks.d.ts +0 -226
  67. package/lib/handlers/node_modules/@types/node/base.d.ts +0 -19
  68. package/lib/handlers/node_modules/@types/node/buffer.d.ts +0 -84
  69. package/lib/handlers/node_modules/@types/node/child_process.d.ts +0 -526
  70. package/lib/handlers/node_modules/@types/node/cluster.d.ts +0 -262
  71. package/lib/handlers/node_modules/@types/node/console.d.ts +0 -133
  72. package/lib/handlers/node_modules/@types/node/constants.d.ts +0 -13
  73. package/lib/handlers/node_modules/@types/node/crypto.d.ts +0 -1580
  74. package/lib/handlers/node_modules/@types/node/dgram.d.ts +0 -141
  75. package/lib/handlers/node_modules/@types/node/diagnostic_channel.d.ts +0 -34
  76. package/lib/handlers/node_modules/@types/node/dns/promises.d.ts +0 -97
  77. package/lib/handlers/node_modules/@types/node/dns.d.ts +0 -322
  78. package/lib/handlers/node_modules/@types/node/domain.d.ts +0 -24
  79. package/lib/handlers/node_modules/@types/node/events.d.ts +0 -93
  80. package/lib/handlers/node_modules/@types/node/fs/promises.d.ts +0 -592
  81. package/lib/handlers/node_modules/@types/node/fs.d.ts +0 -2239
  82. package/lib/handlers/node_modules/@types/node/globals.d.ts +0 -655
  83. package/lib/handlers/node_modules/@types/node/globals.global.d.ts +0 -1
  84. package/lib/handlers/node_modules/@types/node/http.d.ts +0 -434
  85. package/lib/handlers/node_modules/@types/node/http2.d.ts +0 -976
  86. package/lib/handlers/node_modules/@types/node/https.d.ts +0 -36
  87. package/lib/handlers/node_modules/@types/node/index.d.ts +0 -58
  88. package/lib/handlers/node_modules/@types/node/inspector.d.ts +0 -3041
  89. package/lib/handlers/node_modules/@types/node/module.d.ts +0 -52
  90. package/lib/handlers/node_modules/@types/node/net.d.ts +0 -326
  91. package/lib/handlers/node_modules/@types/node/os.d.ts +0 -239
  92. package/lib/handlers/node_modules/@types/node/package.json +0 -232
  93. package/lib/handlers/node_modules/@types/node/path.d.ts +0 -163
  94. package/lib/handlers/node_modules/@types/node/perf_hooks.d.ts +0 -310
  95. package/lib/handlers/node_modules/@types/node/process.d.ts +0 -461
  96. package/lib/handlers/node_modules/@types/node/punycode.d.ts +0 -75
  97. package/lib/handlers/node_modules/@types/node/querystring.d.ts +0 -28
  98. package/lib/handlers/node_modules/@types/node/readline.d.ts +0 -192
  99. package/lib/handlers/node_modules/@types/node/repl.d.ts +0 -395
  100. package/lib/handlers/node_modules/@types/node/stream/promises.d.ts +0 -67
  101. package/lib/handlers/node_modules/@types/node/stream.d.ts +0 -471
  102. package/lib/handlers/node_modules/@types/node/string_decoder.d.ts +0 -7
  103. package/lib/handlers/node_modules/@types/node/timers/promises.d.ts +0 -21
  104. package/lib/handlers/node_modules/@types/node/timers.d.ts +0 -27
  105. package/lib/handlers/node_modules/@types/node/tls.d.ts +0 -793
  106. package/lib/handlers/node_modules/@types/node/trace_events.d.ts +0 -61
  107. package/lib/handlers/node_modules/@types/node/ts3.6/assert.d.ts +0 -98
  108. package/lib/handlers/node_modules/@types/node/ts3.6/base.d.ts +0 -68
  109. package/lib/handlers/node_modules/@types/node/ts3.6/index.d.ts +0 -7
  110. package/lib/handlers/node_modules/@types/node/tty.d.ts +0 -66
  111. package/lib/handlers/node_modules/@types/node/url.d.ts +0 -116
  112. package/lib/handlers/node_modules/@types/node/util/types.d.ts +0 -53
  113. package/lib/handlers/node_modules/@types/node/util.d.ts +0 -156
  114. package/lib/handlers/node_modules/@types/node/v8.d.ts +0 -198
  115. package/lib/handlers/node_modules/@types/node/vm.d.ts +0 -152
  116. package/lib/handlers/node_modules/@types/node/wasi.d.ts +0 -86
  117. package/lib/handlers/node_modules/@types/node/worker_threads.d.ts +0 -282
  118. package/lib/handlers/node_modules/@types/node/zlib.d.ts +0 -361
  119. package/lib/handlers/node_modules/axios/CHANGELOG.md +0 -685
  120. package/lib/handlers/node_modules/axios/LICENSE +0 -19
  121. package/lib/handlers/node_modules/axios/README.md +0 -800
  122. package/lib/handlers/node_modules/axios/UPGRADE_GUIDE.md +0 -162
  123. package/lib/handlers/node_modules/axios/dist/axios.js +0 -1756
  124. package/lib/handlers/node_modules/axios/dist/axios.map +0 -1
  125. package/lib/handlers/node_modules/axios/dist/axios.min.js +0 -3
  126. package/lib/handlers/node_modules/axios/dist/axios.min.map +0 -1
  127. package/lib/handlers/node_modules/axios/index.d.ts +0 -161
  128. package/lib/handlers/node_modules/axios/index.js +0 -1
  129. package/lib/handlers/node_modules/axios/lib/adapters/README.md +0 -37
  130. package/lib/handlers/node_modules/axios/lib/adapters/http.js +0 -303
  131. package/lib/handlers/node_modules/axios/lib/adapters/xhr.js +0 -179
  132. package/lib/handlers/node_modules/axios/lib/axios.js +0 -56
  133. package/lib/handlers/node_modules/axios/lib/cancel/Cancel.js +0 -19
  134. package/lib/handlers/node_modules/axios/lib/cancel/CancelToken.js +0 -57
  135. package/lib/handlers/node_modules/axios/lib/cancel/isCancel.js +0 -5
  136. package/lib/handlers/node_modules/axios/lib/core/Axios.js +0 -95
  137. package/lib/handlers/node_modules/axios/lib/core/InterceptorManager.js +0 -52
  138. package/lib/handlers/node_modules/axios/lib/core/README.md +0 -7
  139. package/lib/handlers/node_modules/axios/lib/core/buildFullPath.js +0 -20
  140. package/lib/handlers/node_modules/axios/lib/core/createError.js +0 -18
  141. package/lib/handlers/node_modules/axios/lib/core/dispatchRequest.js +0 -79
  142. package/lib/handlers/node_modules/axios/lib/core/enhanceError.js +0 -42
  143. package/lib/handlers/node_modules/axios/lib/core/mergeConfig.js +0 -87
  144. package/lib/handlers/node_modules/axios/lib/core/settle.js +0 -25
  145. package/lib/handlers/node_modules/axios/lib/core/transformData.js +0 -20
  146. package/lib/handlers/node_modules/axios/lib/defaults.js +0 -98
  147. package/lib/handlers/node_modules/axios/lib/helpers/README.md +0 -7
  148. package/lib/handlers/node_modules/axios/lib/helpers/bind.js +0 -11
  149. package/lib/handlers/node_modules/axios/lib/helpers/buildURL.js +0 -70
  150. package/lib/handlers/node_modules/axios/lib/helpers/combineURLs.js +0 -14
  151. package/lib/handlers/node_modules/axios/lib/helpers/cookies.js +0 -53
  152. package/lib/handlers/node_modules/axios/lib/helpers/deprecatedMethod.js +0 -24
  153. package/lib/handlers/node_modules/axios/lib/helpers/isAbsoluteURL.js +0 -14
  154. package/lib/handlers/node_modules/axios/lib/helpers/isAxiosError.js +0 -11
  155. package/lib/handlers/node_modules/axios/lib/helpers/isURLSameOrigin.js +0 -68
  156. package/lib/handlers/node_modules/axios/lib/helpers/normalizeHeaderName.js +0 -12
  157. package/lib/handlers/node_modules/axios/lib/helpers/parseHeaders.js +0 -53
  158. package/lib/handlers/node_modules/axios/lib/helpers/spread.js +0 -27
  159. package/lib/handlers/node_modules/axios/lib/utils.js +0 -351
  160. package/lib/handlers/node_modules/axios/package.json +0 -86
  161. package/lib/handlers/node_modules/buffer-from/LICENSE +0 -21
  162. package/lib/handlers/node_modules/buffer-from/index.js +0 -69
  163. package/lib/handlers/node_modules/buffer-from/package.json +0 -19
  164. package/lib/handlers/node_modules/buffer-from/readme.md +0 -69
  165. package/lib/handlers/node_modules/follow-redirects/LICENSE +0 -18
  166. package/lib/handlers/node_modules/follow-redirects/README.md +0 -148
  167. package/lib/handlers/node_modules/follow-redirects/debug.js +0 -14
  168. package/lib/handlers/node_modules/follow-redirects/http.js +0 -1
  169. package/lib/handlers/node_modules/follow-redirects/https.js +0 -1
  170. package/lib/handlers/node_modules/follow-redirects/index.js +0 -531
  171. package/lib/handlers/node_modules/follow-redirects/package.json +0 -59
  172. package/lib/handlers/node_modules/source-map/CHANGELOG.md +0 -301
  173. package/lib/handlers/node_modules/source-map/LICENSE +0 -28
  174. package/lib/handlers/node_modules/source-map/README.md +0 -742
  175. package/lib/handlers/node_modules/source-map/dist/source-map.debug.js +0 -3234
  176. package/lib/handlers/node_modules/source-map/dist/source-map.js +0 -3233
  177. package/lib/handlers/node_modules/source-map/dist/source-map.min.js +0 -2
  178. package/lib/handlers/node_modules/source-map/dist/source-map.min.js.map +0 -1
  179. package/lib/handlers/node_modules/source-map/lib/array-set.js +0 -121
  180. package/lib/handlers/node_modules/source-map/lib/base64-vlq.js +0 -140
  181. package/lib/handlers/node_modules/source-map/lib/base64.js +0 -67
  182. package/lib/handlers/node_modules/source-map/lib/binary-search.js +0 -111
  183. package/lib/handlers/node_modules/source-map/lib/mapping-list.js +0 -79
  184. package/lib/handlers/node_modules/source-map/lib/quick-sort.js +0 -114
  185. package/lib/handlers/node_modules/source-map/lib/source-map-consumer.js +0 -1145
  186. package/lib/handlers/node_modules/source-map/lib/source-map-generator.js +0 -425
  187. package/lib/handlers/node_modules/source-map/lib/source-node.js +0 -413
  188. package/lib/handlers/node_modules/source-map/lib/util.js +0 -488
  189. package/lib/handlers/node_modules/source-map/package.json +0 -73
  190. package/lib/handlers/node_modules/source-map/source-map.d.ts +0 -98
  191. package/lib/handlers/node_modules/source-map/source-map.js +0 -8
  192. package/lib/handlers/node_modules/source-map-support/LICENSE.md +0 -21
  193. package/lib/handlers/node_modules/source-map-support/README.md +0 -284
  194. package/lib/handlers/node_modules/source-map-support/browser-source-map-support.js +0 -114
  195. package/lib/handlers/node_modules/source-map-support/package.json +0 -31
  196. package/lib/handlers/node_modules/source-map-support/register.js +0 -1
  197. package/lib/handlers/node_modules/source-map-support/source-map-support.js +0 -604
@@ -29,4 +29,4 @@ class ErrorResponseFunction extends core_1.Construct {
29
29
  }
30
30
  }
31
31
  exports.ErrorResponseFunction = ErrorResponseFunction;
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQU92RCxNQUFhLHFCQUFzQixTQUFRLGdCQUFTO0lBR2hELFlBQVksS0FBZ0IsRUFBRSxFQUFVLEVBQUUsT0FBcUM7O1FBQzNFLEtBQUss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uICAgICAgICAgICAgICAgIC8vIERlZmluZSBvcHRpb25zIHJlcGxhY2UgdmFsdWVzIGF0IGJ1aWxkIHRpbWUgc28gd2UgY2FuIHVzZSBlbnZpcm9ubWVudCB2YXJpYWJsZXMgdG8gdGVzdCBsb2NhbGx5XG4gICAgICAgICAgICAgICAgLy8gYW5kIHJlcGxhY2UgZHVyaW5nIGJ1aWxkL2RlcGxveSB3aXRoIHN0YXRpYyB2YWx1ZXMuIFRoaXMgZ2V0cyBhcm91bmQgdGhlIGxhbWJkYUBlZGdlIGxpbWl0YXRpb25cbiAgICAgICAgICAgICAgICAvLyBvZiBubyBlbnZpcm9ubWVudCB2YXJpYWJsZXMgYXQgcnVudGltZS5cbiAgICAgICAgICAgICAgICBkZWZpbmU6IHtcbiAgICAgICAgICAgICAgICAgICdwcm9jZXNzLmVudi5QQVRIX1BSRUZJWCc6IEpTT04uc3RyaW5naWZ5KG9wdGlvbnMucGF0aFByZWZpeCA/PyAnJyksXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGFzIGFueSksXG4gICAgICAgICAgICAgIHJ1bnRpbWU6IFJ1bnRpbWUuTk9ERUpTXzE0X1gsXG4gICAgICAgICAgICAgIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApO1xuICAgIH1cbn1cbiJdfQ==
32
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZXJyb3ItcmVzcG9uc2UtY29uc3RydWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHdDQUEwQztBQUMxQyxzRUFBbUU7QUFDbkUsb0RBQThDO0FBQzlDLDREQUF1RDtBQU92RCxNQUFhLHFCQUFzQixTQUFRLGdCQUFTO0lBR2hELFlBQVksS0FB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zTG9ja0ZpbGVQYXRoOiBgJHtfX2Rpcm5hbWV9L2hhbmRsZXJzL3BhY2thZ2UtbG9jay5qc29uYCxcbiAgICAgICAgICAgICAgICAgICAgLy8gRGVmaW5lIG9wdGlvbnMgcmVwbGFjZSB2YWx1ZXMgYXQgYnVpbGQgdGltZSBzbyB3ZSBjYW4gdXNlIGVudmlyb25tZW50IHZhcmlhYmxlcyB0byB0ZXN0IGxvY2FsbHlcbiAgICAgICAgICAgICAgICAgICAgLy8gYW5kIHJlcGxhY2UgZHVyaW5nIGJ1aWxkL2RlcGxveSB3aXRoIHN0YXRpYyB2YWx1ZXMuIFRoaXMgZ2V0cyBhcm91bmQgdGhlIGxhbWJkYUBlZGdlIGxpbWl0YXRpb25cbiAgICAgICAgICAgICAgICAgICAgLy8gb2Ygbm8gZW52aXJvbm1lbnQgdmFyaWFibGVzIGF0IHJ1bnRpbWUuXG4gICAgICAgICAgICAgICAgICAgIGRlZmluZToge1xuICAgICAgICAgICAgICAgICAgICAgICAgJ3Byb2Nlc3MuZW52LlBBVEhfUFJFRklYJzogSlNPTi5zdHJpbmdpZnkob3B0aW9ucy5wYXRoUHJlZml4ID8/ICcnKSxcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gYXMgYW55KSxcbiAgICAgICAgICAgICAgICBydW50aW1lOiBSdW50aW1lLk5PREVKU18xNF9YLFxuICAgICAgICAgICAgICAgIGhhbmRsZXI6ICdpbmRleC5oYW5kbGVyJyxcbiAgICAgICAgICAgIH1cbiAgICAgICAgKTtcbiAgICB9XG59Il19
@@ -1,21 +1,4 @@
1
- import 'source-map-support/register';
2
- import { CloudFrontResponseEvent, CloudFrontResponse } from 'aws-lambda';
3
- /*
4
- Prerender cache control function
5
- Consider associate this function as *origin response* function
6
- */
7
- export const handler = async (event: CloudFrontResponseEvent): Promise<CloudFrontResponse> => {
8
- const cacheKey = process.env.PRERENDER_CACHE_KEY || 'x-prerender-requestid';
9
- const cacheMaxAge = process.env.PRERENDER_CACHE_MAX_AGE || '0';
10
- let response = event.Records[0].cf.response;
1
+ import middy from "@middy/core";
2
+ import { PrerenderCacheControlHandler} from "@aligent/cdk-lambda-at-edge-handlers";
11
3
 
12
- if (response.headers[`${cacheKey}`]) {
13
- response.headers['Cache-Control'] = [
14
- {
15
- key: 'Cache-Control',
16
- value: `max-age=${cacheMaxAge}`
17
- }
18
- ]
19
- }
20
- return response;
21
- }
4
+ export const handler = middy(PrerenderCacheControlHandler);
@@ -1,51 +1,4 @@
1
- import 'source-map-support/register';
2
- import { CloudFrontRequest, CloudFrontResponseEvent, CloudFrontResponse } from 'aws-lambda';
3
- import axios from "axios";
4
- import { URL } from 'url';
5
- import * as https from 'https';
1
+ import middy from "@middy/core";
2
+ import { PrerenderErrorResponseHandler } from "@aligent/cdk-lambda-at-edge-handlers";
6
3
 
7
- const FRONTEND_HOST = process.env.FRONTEND_HOST;
8
- const PATH_PREFIX = process.env.PATH_PREFIX;
9
-
10
- // Create axios client outside of lambda function for re-use between calls
11
- const instance = axios.create({
12
- timeout: 1000,
13
- // Don't follow redirects
14
- maxRedirects: 0,
15
- // Only valid response codes are 200
16
- validateStatus: function (status) {
17
- return status == 200;
18
- },
19
- // keep connection alive so we don't constantly do SSL negotiation
20
- httpsAgent: new https.Agent({ keepAlive: true }),
21
- });
22
-
23
- export const handler = (event: CloudFrontResponseEvent): Promise<CloudFrontResponse|CloudFrontRequest> => {
24
- let response = event.Records[0].cf.response;
25
- let request = event.Records[0].cf.request;
26
-
27
- if (response.status != '200' &&
28
- ! request.headers['x-request-prerender'] &&
29
- request.uri != `${PATH_PREFIX}/index.html`) {
30
-
31
- // Fetch default page and return body
32
- return instance.get(`https://${FRONTEND_HOST}${PATH_PREFIX}/index.html`).then((res) => {
33
- response.body = res.data;
34
-
35
-
36
- response.headers['content-type'] = [{
37
- key: 'Content-Type',
38
- value: 'text/html'
39
- }];
40
-
41
- // Remove content-length if set as this may be the value from the origin.
42
- delete response.headers['content-length']
43
-
44
- return response;
45
- }).catch((err) => {
46
- return response
47
- });
48
- }
49
-
50
- return Promise.resolve(response);
51
- }
4
+ export const handler = middy(PrerenderErrorResponseHandler);