Skip to content
This repository has been archived by the owner on Feb 16, 2018. It is now read-only.

Commit

Permalink
Allow passing json data in through the env
Browse files Browse the repository at this point in the history
  • Loading branch information
titanous committed Sep 19, 2012
1 parent 02a14ac commit c91b25a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tentd/api/router/extract_params.rb
Expand Up @@ -36,7 +36,7 @@ def extract_params(env)

begin
if env['CONTENT_TYPE'] =~ /\bjson\Z/
params['data'] = JSON.parse(env['rack.input'].read)
params['data'] = env['data'] || JSON.parse(env['rack.input'].read)
elsif env['CONTENT_TYPE'] =~ /\Amultipart/
key, data = params.find { |k,p| p[:type] == MEDIA_TYPE }
params.delete(key)
Expand Down

0 comments on commit c91b25a

Please sign in to comment.