Class: TentValidator::TentNetHttpFaradayAdapter

Inherits:
Faraday::Adapter::NetHttp
  • Object
show all
Defined in:
lib/tent-validator/faraday/tent_net_http_adapter.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



4
5
6
7
8
9
10
11
12
13
# File 'lib/tent-validator/faraday/tent_net_http_adapter.rb', line 4

def call(env)
  if Faraday::CompositeReadIO === env[:body]
    env[:request_body] = env[:body].read
    env[:body].rewind
  elsif env[:body]
    env[:request_body] = env[:body]
  end

  super
end