Skip to content

src: fix /download/docs/latest-* links - #1006

Open
flakey5 wants to merge 1 commit into
mainfrom
flakey5/1005
Open

src: fix /download/docs/latest-* links#1006
flakey5 wants to merge 1 commit into
mainfrom
flakey5/1005

Conversation

@flakey5

@flakey5 flakey5 commented Aug 18, 2026

Copy link
Copy Markdown
Member

Kinda messy but works, we should probably find a nicer/easier way to do getR2Path though

Fixes #1005

Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
@flakey5
flakey5 requested a review from a team as a code owner August 18, 2026 01:00
@ovflowd

ovflowd commented Aug 18, 2026

Copy link
Copy Markdown
Member

@flakey5 should this be a rewrite on Cloudflare-level instead of a hacky mapping in here?

@@ -152,7 +152,15 @@ function getR2Path({
if (pathname.startsWith('/dist')) {
return `nodejs/release/${filePath}`;
} else if (pathname.startsWith('/download')) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO none of this (line 152-180) belongs here, this should be part of our custom mapings (ie a Map() or something that contains rewrites/mappings) instead of hardcoded if/else statements. These become larger and larger and harder to maintain, and in general if-statements shouldn't be this deep or convoluted 😅

@flakey5

flakey5 commented Aug 18, 2026

Copy link
Copy Markdown
Member Author

should this be a rewrite on Cloudflare-level instead of a hacky mapping in here?

This makes requests to /download/docs/latest-* do the same logic that we already do for /docs/latest-*, we should definitely look at better options but this is just a solution until then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

https://nodejs.org/download/docs/latest-carbon/ 404's

2 participants