Tags with special URI characters are not readable

Offen
#299 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@aleksandar-cloudinary arbeitet bereits daran.

Seit 12.11.2019.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

bug

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.

Vorherrschende Sprache
Ruby
Sterne
420
Forks
282
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus cloudinary/cloudinary_gem

Alle Issues in cloudinary/cloudinary_gem

Ähnliche Issues

Weitere Issues zu Ruby

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.