seancribbs/webmachine-ruby — Issue #15: URI.unescape vs. CGI.unescape
Author: jamis
Created: 2011-10-26 02:52:25+00:00
State: open
Labels: bug

Request#query currently uses URI.unescape to unquote the key/value pairs in the query string. However, URI.unescape is not as thorough as CGI.unescape; for example, consider the following:

```ruby
q = "x=two+words&y=two%20words"
puts URI.unescape(q) # -> "x=two+words&y=two words"
puts CGI.unescape(q) # -> "x=two words&y=two words"
```

In other words, CGI.unescape knows that `+` characters should be converted to spaces.

Would you have any objections to Request#query changing to use CGI.unescape instead of URI.unescape?