Skip to content

Commit

Permalink
Don't set params to an empty hash unless body is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Apr 6, 2011
1 parent 0e76081 commit c71c3eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/faraday/request/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Request::OAuth < Faraday::Middleware
dependency 'simple_oauth'

def call(env)
params = env[:body].is_a?(Hash) ? env[:body] : {}
params = env.fetch(:body, {})

signature_params = params.reject{ |k,v| v.respond_to?(:content_type) }

Expand All @@ -20,4 +20,4 @@ def initialize(app, options)
@app, @options = app, options
end
end
end
end

0 comments on commit c71c3eb

Please sign in to comment.