basho/riak-ruby-client — pull request #80 by bkerley (2014-10-02 23:25:58+00:00)
Title: robject object with ? in its key has its key truncated when stored via http

Behavior is different between PBC and HTTP in the storage of a key, but the retrieval of a key works correctly over both PBC and HTTP.

lib/riak/util/escape.rb doesn't seem to properly handle a question mark (and presumably other non-urlsafe characters) in the key string around line 55, when Riak.escaper is set to the default URI class: `Riak.escaper.escape(bucket_or_key.to_s).gsub(" ", "%20").gsub("+", "%2B").gsub('/', "%2F")`

`http://test.com/?stuff` is improperly escaped to `http:%2F%2Ftest.com%2F?stuff`
which is oddly semi-escaped. It seems like it should be escaped using CGI to `http%3A%2F%2Ftest.com%2F%3Fstuff` by default.

In testing i found that setting `Riak.escaper = CGI` saved the entire key, whether over PBC or HTTP, so I am wondering what other side effects might be expected with the escaper set to CGI by default, as it seems that it would better handle a wider variety of keys that way without unexpected truncation.