Skip to content

Commit

Permalink
Minor change to return language, include actual link, and also catch …
Browse files Browse the repository at this point in the history
…307s
  • Loading branch information
jswift committed Jun 14, 2024
1 parent 12bbef3 commit 12931a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions packages/prerender-fargate/lib/prerender/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,9 @@ server.use({
headerMatch = headerMatchRegex.exec(head)
}

if (['301', '302'].includes(req.prerender.statusCode )) {
req.prerender.content = `This page has moved, redirecting to ${s3Metadata.location}...`;
if (['301', '302', '307'].includes(req.prerender.statusCode )) {
const permanentlyOrTemporarily = req.prerender.statusCode === '301' ? 'permanently': 'temporarily';
req.prerender.content = `This page has ${permanentlyOrTemporarily} moved, redirecting to <a href="${s3Metadata.location}">${s3Metadata.location}</a>...`;
}

if ( statusCodesToCache.includes(req.prerender.statusCode.toString()) ){
Expand Down
2 changes: 1 addition & 1 deletion packages/prerender-fargate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aligent/cdk-prerender-fargate",
"version": "2.5.0",
"version": "2.5.1",
"description": "A construct to host Prerender in Fargate",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 12931a6

Please sign in to comment.