src: fix /download/docs/latest-* links - #1006
Conversation
Signed-off-by: flakey5 <73616808+flakey5@users.noreply.github.com>
|
@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')) { | |||
There was a problem hiding this comment.
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 😅
This makes requests to |
|
@flakey5 DMd me and mentioned they are going to work on this 🙇 |
Kinda messy but works, we should probably find a nicer/easier way to do
getR2PaththoughFixes #1005