* Fix autoloading for RateLimitChecker * Fix autoloading for ForemStatsClient * Fix autoloading for middlewares * Move things to their proper place * Move middleware usage to the proper place * Re-add rest-client in datadog driver correctly * Already required in config/initializers/middlewares.rb * Bring that back * Fix Honeybadger spec
10 lines
237 B
Ruby
10 lines
237 B
Ruby
class ApiConstraints
|
|
def initialize(options)
|
|
@version = options[:version]
|
|
@default = options[:default]
|
|
end
|
|
|
|
def matches?(req)
|
|
@default || req.headers["Accept"].include?("application/vnd.example.v#{@version}")
|
|
end
|
|
end
|