Skip to content

Commit

Permalink
Update component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
engdevopsaapc authored Jun 3, 2024
1 parent 869b6a8 commit d31c36f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions packages/serverless-components/nextjs-component/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,44 @@ class NextjsComponent extends Component {
"origin-response": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`
}
};
cloudFrontOrigins[1].pathPatterns[
this.pathPattern("/shop/*", routesManifest)
] = {
minTTL: 0,
defaultTTL: 0,
maxTTL: 86400,
forward: {
cookies: "all",
headers: routesManifest.i18n
? ["Accept-Language", "Authorization", "Host"]
: ["Authorization", "Host"],
queryString: true
},
// lambda@edge key is last and therefore cannot be overridden
"lambda@edge": {
"origin-request": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`,
"origin-response": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`
}
};
cloudFrontOrigins[1].pathPatterns[

Check notice on line 1049 in packages/serverless-components/nextjs-component/src/component.ts

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

packages/serverless-components/nextjs-component/src/component.ts#L1049

Replace `↹` with `··`
this.pathPattern("/shop", routesManifest)
] = {
minTTL: 0,
defaultTTL: 0,
maxTTL: 86400,
forward: {
cookies: "all",
headers: routesManifest.i18n
? ["Accept-Language", "Authorization", "Host"]
: ["Authorization", "Host"],
queryString: true
},
// lambda@edge key is last and therefore cannot be overridden
"lambda@edge": {
"origin-request": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`,
"origin-response": `${defaultEdgeLambdaOutputs.arn}:${defaultEdgeLambdaPublishOutputs.version}`
}
};

// If we are using consolidated API pages (within default lambda), we need to ensure api/* behavior is set correctly.
// Note that if there are no consolidated API pages then existing api/* is not deleted.
Expand Down

0 comments on commit d31c36f

Please sign in to comment.