Cloudflare R2 public bucket urls with %27 not found

Urls with %27 in the file name are not being found
19 Replies
Řambo
ŘamboOP16mo ago
Řambo
ŘamboOP16mo ago
Řambo
ŘamboOP16mo ago
only the ones with %27 are getting 404 error. the rest work fine
Yatsuki
Yatsuki16mo ago
why there is a %27 in the file name
Řambo
ŘamboOP16mo ago
its a single quote
Yatsuki
Yatsuki16mo ago
ooh url encoding is the reason ig u can't use quote in filename
Řambo
ŘamboOP16mo ago
ya thats what i was thinking. is that cloudflare related thing?
Yatsuki
Yatsuki16mo ago
i don't think so it's just how browsers work
Řambo
ŘamboOP16mo ago
cuz looks here. this works just fine https://static.wikia.nocookie.net/leagueoflegends/images/7/70/Kai%27Sa_Select.ogg its using %27 as the single quote so i dont understand why it wouldnt work
Yatsuki
Yatsuki16mo ago
maybe the way how cloudflare encode the file names ?
Řambo
ŘamboOP16mo ago
idk, maybe re-named to this Kai-Sa_Original_FilterOff_MoveFirst_6.ogg and it works. Wish there was a way for this to work so I won't have to go and change the names
Yatsuki
Yatsuki16mo ago
i never saw someone using quotes tho it's very uncommon
Řambo
ŘamboOP16mo ago
if anyone else knows an easy fix for this, please let me know. otherwise i'll just rename all the files
Erisa
Erisa16mo ago
Hey @Řambo, I believe what's happening here is that R2 is decoding the %27 to ' before it looks it up in the bucket. Since you have %27 literally in your object name it won't see it when it looks for the one with ' after decoding that in the URL. The fix would be to have the filename unaltered in the bucket. I.e. set the filename of the object to Kai'Sa_Original_FilterOff_MoveFirst_6.ogg rather than the URL encoded form. That should be a valid filename Tried this with mine but quickly realised I'm using a Worker so it wont be the same, let me try with a pub bucket Works for me with that filename: https://pub-8fbfda42fe2145408e90b5315377f1a3.r2.dev/Kai'Sa_Select.ogg or https://pub-8fbfda42fe2145408e90b5315377f1a3.r2.dev/Kai%27Sa_Select.ogg both lead to the same object (since it's the same URL under the hood of the browser hiding it for you)
Erisa
Erisa16mo ago
Řambo
ŘamboOP16mo ago
i see, that makes sense. tysm
Erisa
Erisa16mo ago
No problem 🙂 I will now have that voice ringing in my head for the rest of the day after my browser kept autoplaying it on the test urls 🤣
Řambo
ŘamboOP16mo ago
are you the hunter, or the prey?
Want results from more Discord servers?
Add your server