Class: FaradayThrottler::Fallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/faraday_throttler/fallbacks.rb

Constant Summary collapse

DEFAULT_CONTENT_TYPE =
'application/json'.freeze

Instance Method Summary collapse

Instance Method Details

#call(req) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/faraday_throttler/fallbacks.rb', line 5

def call(req)
  {
    url: req[:url],
    status: 204,
    body: '',
    response_headers: {
      'Content-Type' => req.fetch(:request_headers, {}).fetch('Content-Type', DEFAULT_CONTENT_TYPE)
    }
  }
end