Skip to content

Loading…

Custom FaradayMiddleware OAuth2 class name to avoid conflict with other gems implementing FaradayMiddleware OAuth2. #53

Merged
merged 1 commit into from

2 participants

@rickpern

I use this gem along with youtube_it, which both define FaradayMiddleware::OAuth2, thus overriding each other and conflicting. This solution keeps the middleware in the Faraday namespace, but just defines a specific Instagram implementations.

@apatlola apatlola referenced this pull request in kylejginavan/youtube_it
Closed

Faraday conflict #114

@shayne shayne merged commit 45d965a into Instagram:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 13, 2012
  1. @rickpern
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/faraday/oauth2.rb
  2. +1 −1 lib/instagram/connection.rb
View
2 lib/faraday/oauth2.rb
@@ -3,7 +3,7 @@
# @private
module FaradayMiddleware
# @private
- class OAuth2 < Faraday::Middleware
+ class InstagramOAuth2 < Faraday::Middleware
def call(env)
if env[:method] == :get or env[:method] == :delete
View
2 lib/instagram/connection.rb
@@ -15,7 +15,7 @@ def connection(raw=false)
}
Faraday::Connection.new(options) do |connection|
- connection.use FaradayMiddleware::OAuth2, client_id, access_token
+ connection.use FaradayMiddleware::InstagramOAuth2, client_id, access_token
connection.use Faraday::Request::UrlEncoded
connection.use FaradayMiddleware::Mashify unless raw
unless raw
Something went wrong with that request. Please try again.