lib/hanami/router.rb in hanami-router-2.0.0.rc1 vs lib/hanami/router.rb in hanami-router-2.0.0
- old
+ new
@@ -8,10 +8,11 @@
# Rack compatible, lightweight and fast HTTP Router.
#
# @since 0.1.0
class Router
require "hanami/router/version"
+ require "hanami/router/constants"
require "hanami/router/errors"
require "hanami/router/segment"
require "hanami/router/redirect"
require "hanami/router/prefix"
require "hanami/router/params"
@@ -917,10 +918,10 @@
# @api private
def _params(env, params)
params ||= {}
env[PARAMS] ||= {}
- if (input = env[::Rack::RACK_INPUT]) and input.rewind
+ if !env.key?(ROUTER_PARSED_BODY) && (input = env[::Rack::RACK_INPUT]) and input.rewind
env[PARAMS].merge!(::Rack::Utils.parse_nested_query(input.read))
input.rewind
end
env[PARAMS].merge!(::Rack::Utils.parse_nested_query(env[::Rack::QUERY_STRING]))