# File features/support/local_server.rb, line 22 def call(env) if env['rack.input'] and not input_parsed?(env) and type_match?(env) env['rack.request.form_input'] = env['rack.input'] data = env['rack.input'].read env['rack.request.form_hash'] = data.empty?? {} : JSON.parse(data) end app.call(env) end
# File features/support/local_server.rb, line 31 def input_parsed? env env['rack.request.form_input'].eql? env['rack.input'] end
# File features/support/local_server.rb, line 35 def type_match? env type = env['CONTENT_TYPE'] and type.split(/\s*[;,]\s*/, 2).first.downcase == 'application/json' end