Cloudflare R2 public bucket urls with %27 not found
Urls with
%27
in the file name are not being found19 Replies
only the ones with
%27
are getting 404 error. the rest work finewhy there is a %27 in the file name
its a single quote
ooh url encoding is the reason
ig u can't use quote in filename
ya thats what i was thinking.
is that cloudflare related thing?
i don't think so it's just how browsers work
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
maybe the way how cloudflare encode the file names ?
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 namesi never saw someone using quotes tho
it's very uncommon
if anyone else knows an easy fix for this, please let me know. otherwise i'll just rename all the files
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)i see, that makes sense. tysm
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 🤣
are you the hunter, or the prey?