Skip to content
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

Tags with special URI characters are not readable #299

Open
jqr opened this issue Apr 9, 2018 · 1 comment
Open

Tags with special URI characters are not readable #299

jqr opened this issue Apr 9, 2018 · 1 comment
Assignees
Labels

Comments

@jqr
Copy link

jqr commented Apr 9, 2018

Tags that contain non-uri-component-safe characters are not readable using the resources_by_tag method. Example:

tag = 'with/some?bad=characters'
Cloudinary::Uploader.upload(url, tags: [tag]) # correctly encodes value

# will not see the upload
Cloudinary::Api.resources_by_tag(tag) 
# because uri = "resources/#{resource_type}/tags/#{tag}"

# Work around, will see the upload
Cloudinary::Api.resources_by_tag(URI.encode_www_form_component(tag)) 

This looks to be caused by assembling the URI without encoding.

I'm opening an issue rather than a pull request because the code seems to have a lot of direct URI assembling, so the issue almost certainly exists elsewhere in the code. Most sites seem to have more constrained elements (type, public_id, etc.), but it does not hurt to encode them too.

@marissa-masangcay
Copy link

Hi,

Thanks for bringing this to our attention. I have submitted this issue to our devs and will provide updates on this issue.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants