From c4c815977603644a30536337a39c70257d438923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Sabat=C3=A9?= Date: Tue, 19 Dec 2023 15:46:53 +0100 Subject: [PATCH] fix: 400 Bad request when creating CachePolicy on the Distribution. (#188) AllowList accept-encoding headerBehaviour is not compatible with enableAcceptEncodingGzip: true. My recommendation is to remove accept-encoding from allowList headerBehaviour as default. And the final user can amend as they wish. But like this, the default options will be functional. --- src/NextjsDistribution.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/NextjsDistribution.ts b/src/NextjsDistribution.ts index 33502bde..c7c2a996 100644 --- a/src/NextjsDistribution.ts +++ b/src/NextjsDistribution.ts @@ -250,7 +250,6 @@ export class NextjsDistribution extends Construct { queryStringBehavior: cloudfront.CacheQueryStringBehavior.all(), headerBehavior: cloudfront.CacheHeaderBehavior.allowList( 'accept', - 'accept-encoding', 'rsc', 'next-router-prefetch', 'next-router-state-tree',