lib/faraday/api_key.rb in reviewed-0.1.26 vs lib/faraday/api_key.rb in reviewed-0.1.27
- old
+ new
@@ -1,11 +1,13 @@
module Faraday
class ApiKey < Faraday::Middleware
def call(env)
- unless env.request.headers['X-Reviewed-Authorization']
+ unless env[:request_headers]['X-Reviewed-Authorization']
raise ::Reviewed::ConfigurationError.new("Please set the API key for your Reviewed::Client instance before making a request")
end
+
+ @app.call(env)
end
end
end
Faraday.register_middleware :request, api_key: Faraday::ApiKey