Skip to content

Commit d4ca6c4

Browse files
author
Frank
committed
Nextjs: only special handle _next as deep route
1 parent 5c0c25d commit d4ca6c4

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

platform/src/components/aws/nextjs.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -650,36 +650,36 @@ export class Nextjs extends SsrSite {
650650
},
651651
...(queueArn
652652
? [
653-
{
654-
actions: [
655-
"sqs:SendMessage",
656-
"sqs:GetQueueAttributes",
657-
"sqs:GetQueueUrl",
658-
],
659-
resources: [queueArn],
660-
},
661-
]
653+
{
654+
actions: [
655+
"sqs:SendMessage",
656+
"sqs:GetQueueAttributes",
657+
"sqs:GetQueueUrl",
658+
],
659+
resources: [queueArn],
660+
},
661+
]
662662
: []),
663663
...(tableArn
664664
? [
665-
{
666-
actions: [
667-
"dynamodb:BatchGetItem",
668-
"dynamodb:GetRecords",
669-
"dynamodb:GetShardIterator",
670-
"dynamodb:Query",
671-
"dynamodb:GetItem",
672-
"dynamodb:Scan",
673-
"dynamodb:ConditionCheckItem",
674-
"dynamodb:BatchWriteItem",
675-
"dynamodb:PutItem",
676-
"dynamodb:UpdateItem",
677-
"dynamodb:DeleteItem",
678-
"dynamodb:DescribeTable",
679-
],
680-
resources: [tableArn, `${tableArn}/*`],
681-
},
682-
]
665+
{
666+
actions: [
667+
"dynamodb:BatchGetItem",
668+
"dynamodb:GetRecords",
669+
"dynamodb:GetShardIterator",
670+
"dynamodb:Query",
671+
"dynamodb:GetItem",
672+
"dynamodb:Scan",
673+
"dynamodb:ConditionCheckItem",
674+
"dynamodb:BatchWriteItem",
675+
"dynamodb:PutItem",
676+
"dynamodb:UpdateItem",
677+
"dynamodb:DeleteItem",
678+
"dynamodb:DescribeTable",
679+
],
680+
resources: [tableArn, `${tableArn}/*`],
681+
},
682+
]
683683
: []),
684684
],
685685
injections: [
@@ -726,7 +726,7 @@ export class Nextjs extends SsrSite {
726726
to: "_assets",
727727
cached: true,
728728
versionedSubDir: "_next",
729-
deepRoute: true,
729+
deepRoute: "_next",
730730
},
731731
],
732732
isrCache: {

platform/src/components/aws/ssr-site.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export type Plan = {
102102
to: string;
103103
cached: boolean;
104104
versionedSubDir?: string;
105-
deepRoute?: boolean;
105+
deepRoute?: string;
106106
}[];
107107
isrCache?: {
108108
from: string;
@@ -1295,7 +1295,7 @@ async function handler(event) {
12951295
// image optimization requests are prefixed with /_next/image. We cannot
12961296
// route by 1 level of subdirs (ie. /_next/`), so we need to route by 2
12971297
// levels of subdirs.
1298-
if (!copy.deepRoute) {
1298+
if (item.name !== copy.deepRoute) {
12991299
dirs.push(path.posix.join("/", item.name));
13001300
return;
13011301
}

0 commit comments

Comments
 (0)