From 3b004dda67af90e077f1237aea38966e7d2ffd92 Mon Sep 17 00:00:00 2001 From: conico974 Date: Sun, 12 May 2024 15:17:54 +0200 Subject: [PATCH] Fix for external middleware (#412) * do not remove read only headers * Create warm-waves-allow.md --- .changeset/warm-waves-allow.md | 5 +++++ packages/open-next/src/converters/aws-cloudfront.ts | 10 ---------- 2 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 .changeset/warm-waves-allow.md diff --git a/.changeset/warm-waves-allow.md b/.changeset/warm-waves-allow.md new file mode 100644 index 00000000..0dc8523c --- /dev/null +++ b/.changeset/warm-waves-allow.md @@ -0,0 +1,5 @@ +--- +"open-next": patch +--- + +Fix for external middleware diff --git a/packages/open-next/src/converters/aws-cloudfront.ts b/packages/open-next/src/converters/aws-cloudfront.ts index ba969e5c..3a35dd78 100644 --- a/packages/open-next/src/converters/aws-cloudfront.ts +++ b/packages/open-next/src/converters/aws-cloudfront.ts @@ -48,16 +48,6 @@ const CloudFrontBlacklistedHeaders = [ "x-cache", "x-forwarded-proto", "x-real-ip", - - // Read-only headers, see: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/edge-function-restrictions-all.html#function-restrictions-read-only-headers - "accept-encoding", - "content-length", - "if-modified-since", - "if-none-match", - "if-range", - "if-unmodified-since", - "transfer-encoding", - "via", ]; function normalizeCloudFrontRequestEventHeaders(