fcoury / octopi

A Ruby interface to GitHub API v2
http://hasmany.info/2009/4/18/ruby-interface-to-github-api
MIT License
216 stars 47 forks source link

Investigate How Repository.find_all Treats URI Escapes #8

Open runpaint opened 15 years ago

runpaint commented 15 years ago

The query for Repository.find_all is an Array of words concatenated with '+' signs. Oddly, separating the words with percent-encoded spaces doesn't work. What does this imply about the suitability of URI-escaping the query? We need to do something with special characters, or they'll mess up the URL we generate. Do we just escape as normal, but replace spaces with '+'?

radar commented 15 years ago

Do you have any examples of any repositories with characters that need to be escaped?

runpaint commented 15 years ago

IIRC, it wasn't the name of the repository, it was that .find_all took an arbitrary string then only superficially munged it before constructing the URL. While repository names are presumably limited to US-ASCII, their descriptions and author names aren't.

Sorry for not providing a test case. :-/