<NME> route.rb
<BEF> require 'set'

class HttpRouter
  class Route
    # The list of HTTP request methods supported by HttpRouter.
    VALID_HTTP_VERBS = %w{GET POST PUT DELETE HEAD OPTIONS TRACE PATCH OPTIONS LINK UNLINK}
    VALID_HTTP_VERBS_WITHOUT_GET = VALID_HTTP_VERBS - %w{GET}

    attr_reader :default_values, :other_hosts, :paths, :request_methods, :name
    attr_accessor :match_partially, :router, :host, :user_agent, :ignore_trailing_slash,
                  :path_for_generation, :path_validation_regex, :generator, :scheme, :original_path, :dest

    def create_clone(new_router)
      r = clone
      r.dest = (begin; dest.clone; rescue; dest; end)
      r
    end

    def to_s
      "#<HttpRouter:Route #{object_id} @path_for_generation=#{path_for_generation.inspect}>"
    end

    def matches_with(var_name)
      @match_with && @match_with[:"#{var_name}"]
    end

    def name=(name)
      @name = name
      router.named_routes[name] << self if router
    end
  end
end
      path_obj
    end

    def append_querystring(uri, params)
      if params && !params.empty?
        uri_size = uri.size
        params.each do |k,v|
          case v
          when Array
            v.each { |v_part| uri << '&' << ::Rack::Utils.escape(k.to_s) << '%5B%5D=' << ::Rack::Utils.escape(v_part.to_s) }
          else
            uri << '&' << ::Rack::Utils.escape(k.to_s) << '=' << ::Rack::Utils.escape(v.to_s)
          end
        end
        uri[uri_size] = ??
      end
      uri

<MSG> recursive query string generation - fixes hashes

<DFF> @@ -284,17 +284,22 @@ class HttpRouter
       path_obj
     end
 
+    def append_querystring_value(uri, key, value)
+      case value
+      when Array
+        k = "#{key}[]"
+        value.each{ |v| append_querystring_value(uri, k, v) }
+      when Hash
+        value.each{ |k, v| append_querystring_value(uri, "#{key}[#{k}]", v) }
+      else
+        uri << '&' << ::Rack::Utils.escape(key.to_s) << '=' << ::Rack::Utils.escape(value.to_s)
+      end
+    end
+
     def append_querystring(uri, params)
       if params && !params.empty?
         uri_size = uri.size
-        params.each do |k,v|
-          case v
-          when Array
-            v.each { |v_part| uri << '&' << ::Rack::Utils.escape(k.to_s) << '%5B%5D=' << ::Rack::Utils.escape(v_part.to_s) }
-          else
-            uri << '&' << ::Rack::Utils.escape(k.to_s) << '=' << ::Rack::Utils.escape(v.to_s)
-          end
-        end
+        params.each{ |k,v|  append_querystring_value(uri, k, v) }
         uri[uri_size] = ??
       end
       uri

{'addition_count': 13, 'commit_subject': 'recursive query string generation - fixes hashes', 'deletion_count': 8, 'file_extension': '.rb', 'lang': 'rb', 'license': 'mit', 'repo_name': 'joshbuddy/http_router'}