Skip to content

Commit

Permalink
Fix grapher 404 page (#3951)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyi authored Sep 11, 2024
1 parent aec5114 commit be9c4e3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions functions/grapher/[slug].ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,7 @@ async function handleHtmlPageRequest(

const grapherPageResp = await env.ASSETS.fetch(url, { redirect: "manual" })

if (grapherPageResp.status === 404) {
throw new StatusError(404)
}

// A non-200 status code is most likely a redirect (301 or 302), all of which we want to pass through as-is.
// A non-200 status code is most likely a redirect (301 or 302) or 404, all of which we want to pass through as-is.
// In the case of the redirect, the browser will then request the new URL which will again be handled by this worker.
if (grapherPageResp.status !== 200) return grapherPageResp

Expand Down

0 comments on commit be9c4e3

Please sign in to comment.