nodejs / release-cloudflare-worker

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

`.txt.asc` files are downloaded instead of displayed in browser #69

Closed targos closed 10 months ago

targos commented 10 months ago

Compare https://nodejs.org/dist/v21.2.0/SHASUMS256.txt.asc With https://r2.nodejs.org/dist/v21.2.0/SHASUMS256.txt.asc

flakey5 commented 10 months ago

I believe this is because there's a difference in the content-type headers, nginx returns content-type: text/plain while R2 returns content-type: application/pgp-keys. The content type for each file is stored in R2's metadata, I don't believe we can update it after uploading but I could be wrong.

A simple fix would be to just check if it's a .asc file when constructing the serve file response and send a text/plain content type instead of whatever R2 has it as. We already do check if it's a .json file for CORS headers

targos commented 10 months ago

This one is probably not a big deal. I'm ok with just closing the issue.

ovflowd commented 10 months ago

I also think this is not a big deal, just funny that R2 has a different content/type for this than nginx.