New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
URL getting double/improperly encoded when % percent sign is present #2561
Comments
Just wanna add on to say I had this issue come up in another spot in my codebase. It's not really about the retina version obviously, it's about the |
Another update on this. |
Current workaround to fix this issue globally is in my base uploader mixin: module MyBaseUploader
def url(*)
super&.gsub('%25', '%')
end
end
class SomeUploader < Carrierwave::Base::Uploader
include MyBaseUploader
end Since so far what needs to be fixed here is that the % is already involved in encoding some other character, but has itself been encoded, so the URLs which have encoded characters in them are being sort of over-encoded |
Tried with the filename |
Hi there - Rails 6.1 with Carrierwave main github branch (I need the fix mentioned here #2415 (comment))
So we have an uploader with a retina version with code like this:
And when I call
model.logo.retina.url
I get something like this:I can see that
%25
is supposed to be the % sign itself, and it should be forming%40
for the@
sign but it's not and therefore AWS bonks out with AccessDenied (which is how they handle 404)For now my workaround is to use
URI.decode(model.logo.retina.url)
and I'm very lucky I only have this one retina version on one uploader, referenced in one place in my code, but you can imagine this would get out of hand, and I assume there should be (and might be, but I can't find it) a better way to handle this?Thanks!
The text was updated successfully, but these errors were encountered: