nodejs / release-cloudflare-worker

Infra for serving Node.js downloads and documentation.
https://nodejs.org/dist
MIT License
22 stars 5 forks source link

http 404 for https://nodejs.org/download/release/latest/win-x64/node_pdb.7z #71

Closed ShenHongFei closed 10 months ago

ShenHongFei commented 10 months ago

URL:

https://nodejs.org/download/release/latest/win-x64/node_pdb.7z

Browser Name:

Chrome

Browser Version:

119.0.6045.124

Operating System:

Windows 11

How to reproduce the issue:

try download latest node_pdb.7z file https://nodejs.org/download/release/latest/win-x64/node_pdb.7z

ShenHongFei commented 10 months ago

https://nodejs.org/download/release/latest/win-x64/node_pdb.zip zip can be downloaded without problem.

ovflowd commented 10 months ago

For some reason the worker seemed to want to do directory listing on that path.

When I accessed that path it said "Directory Not Found", which is odd, and it even tried to redirect to nodejs.org/download/release/latest/win-x64/node_pdb.7z/ with a / in the end.

There some wonky logic we need to patch.

flakey5 commented 10 months ago

This has to deal with another heuristic we do when determining directory paths vs file paths.

It thinks its a directory because of this line https://github.com/nodejs/release-cloudflare-worker/blob/0e9ec8b42533dfe95a5e45992c546615e3e941dc/src/util.ts#L228. Number.parseInt('7z') returns 7 for some reason

ovflowd commented 10 months ago

This has to deal with another heuristic we do when determining directory paths vs file paths.

It thinks its a directory because of this line https://github.com/nodejs/release-cloudflare-worker/blob/0e9ec8b42533dfe95a5e45992c546615e3e941dc/src/util.ts#L228. Number.parseInt('7z') returns 7 for some reason

Thats per spec. You should use Number() instead of parseInt()