randysecrist/riak-ruby-client — pull request #1 by randysecrist (2012-06-14 17:30:34+00:00)
Title: Make URI escape the '+' character.

Consider the following difference in how URI and CGI handle a email address using a reserved (but allowable character) in the local part of the address:

```ruby
require 'cgi'
require 'uri'

input = 'test.foo+bar@example.com'
CGI.escape(input) => "test.foo%2Bbar%40example.com"
URI.escape(input) => "test.bar+bar@example.com"
```

URI's default rules for escaping include anything that is not a URI::PATTERN::UNRESERVED or URI::PATTERN::RESERVED character. Being within the reserved set, by default, '+' is considered safe; however with riak, it is in fact unsafe.

```bash
curl http://riakhost/buckets/users/index/email_bin/test.foo%2Bbar@example.com
{"keys":["AqV0JuwQJYlag3NQX9D6NYVo6If"]}%
curl http://riakhost/buckets/users/index/email_bin/test.foo+bar@example.com
{"keys":[]}%
```

Would you have any objections to making URI treat the '+' as unsafe?