lib/hanami/action/rack.rb in hanami-controller-0.7.0 vs lib/hanami/action/rack.rb in hanami-controller-0.7.1

- old
+ new

@@ -40,10 +40,13 @@ # # @since 0.3.2 # @api private HEAD = 'HEAD'.freeze + # The key that returns router parsed body from the Rack env + ROUTER_PARSED_BODY = 'router.parsed_body'.freeze + # Override Ruby's hook for modules. # It includes basic Hanami::Action modules to the given class. # # @param base [Class] the target action # @@ -198,9 +201,13 @@ # secure = request.ssl? # end # end def request @request ||= ::Hanami::Action::Request.new(@_env) + end + + def parsed_request_body + @_env.fetch(ROUTER_PARSED_BODY, nil) end private # Sets the HTTP status code for the response