basho/riak_kv — pull request #543 by broach (2013-05-03 20:37:41+00:00)
Title: url encode/decode 2i headers

This stems from the StackOverflow Q found here:
http://stackoverflow.com/questions/16335296/url-unsafe-secondary-index-names-in-riak-do-not-work

Currently we don't URL-decode the field-name or the value of x-riak-index-*
headers on a POST/PUT. The problem then arrises that on a GET for an index
you need to url-encode then url-escape everything because we do url-decode the
hierarchical part of the URL. It also then means that the same query
using protocol buffers has to be url-encoded which is ... silly.

By url-decoding the field-name and the value then storing the raw bytes we
avoid all this confusion. GET requests work as expected using HTTP and PB
queries do not have to be URL encoded.

The one outstanding consideration is ... what to do about people who
are currently URL-encoding / escaping, etc. When the decoding was added
for the GET (which is actually what broke this, ironically enough) there
was a environment setting and an optional header added to toggle the feature
on/off (see riak_kv_wm_utils:maybe_decode_uri/2 - today the default is "on")

I can easily add the same type of thing which I'm thinking we may have to do?