Skip to content

Commit

Permalink
chore(SLB-394): port page-data 404
Browse files Browse the repository at this point in the history
  • Loading branch information
colorfield committed May 29, 2024
1 parent c1f3563 commit 84a4728
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
9 changes: 0 additions & 9 deletions apps/cms/gatsby-node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ export const createPages = async ({ actions }) => {
});
});

// Broken Gatsby links will attempt to load page-data.json files, which don't exist
// and also should not be piped into the strangler function. Thats why they
// are caught right here.
actions.createRedirect({
fromPath: '/page-data/*',
toPath: '/404',
statusCode: 404,
});

// @todo port Drupal webforms and other assets proxy with Cloudflare Functions.
// // Proxy Drupal webforms.
// Object.values(Locale).forEach((locale) => {
Expand Down
6 changes: 6 additions & 0 deletions apps/website/functions/page-data/[[file]].ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Broken Gatsby links will attempt to load page-data.json files, which don't exist
// and also should not be piped into the strangler function. Thats why they
// are caught right here.
export const onRequestGet: PagesFunction = async () => {
return new Response('Not found', { status: 404 });
};
11 changes: 1 addition & 10 deletions apps/website/gatsby-node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,7 @@ export const createPages = async ({ actions }) => {
});
});

// @todo port page-data 404 and strangler to Cloudflare Functions.
// // Broken Gatsby links will attempt to load page-data.json files, which don't exist
// // and also should not be piped into the strangler function. Thats why they
// // are caught right here.
// actions.createRedirect({
// fromPath: '/page-data/*',
// toPath: '/404',
// statusCode: 404,
// });
//
// @todo port strangler to Cloudflare Functions.
// // Any unhandled requests are handed to strangler, which will try to pass
// // them to all registered legacy systems and return 404 if none of them
// // respond.
Expand Down

0 comments on commit 84a4728

Please sign in to comment.