lib/angelo/params_parser.rb in angelo-0.3.2 vs lib/angelo/params_parser.rb in angelo-0.3.3
- old
+ new
@@ -5,23 +5,20 @@
class FormEncodingError < StandardError; end
module ParamsParser
EMPTY_JSON = '{}'
- SEMICOLON = ';'
- EQUALS = '='
- AMPERSAND = '&'
def parse_formencoded str
str.split(AMPERSAND).reduce(Responder.symhash) do |p, kv|
key, value = kv.split(EQUALS).map {|s| CGI.unescape s}
p[key] = value
p
end
end
def parse_query_string
- parse_formencoded(request.query_string || '')
+ parse_formencoded(request.query_string || EMPTY_STRING)
end
def parse_post_body
body = request.body.to_s
qs = parse_query_string