Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Pulling user agent out of configuration options.

  • Loading branch information...
commit 27f5cee19d8888b90c66b55389d61c1b53098a13 1 parent 8967584
@aac aac authored
Showing with 11 additions and 3 deletions.
  1. +1 −1  Rakefile
  2. +10 −2 lib/authlogic_connect/oauth/tokens/oauth_token.rb
View
2  Rakefile
@@ -6,7 +6,7 @@ require 'rake/gempackagetask'
spec = Gem::Specification.new do |s|
s.name = "authlogic-connect-andrewacove"
s.authors = ['Lance Pollard', 'Andrew Cove']
- s.version = '0.5.5'
+ s.version = '0.5.6'
s.summary = "Personal fork of Authlogic Connect: Oauth and OpenID made dead simple"
s.homepage = "http://github.com/andrewacove/authlogic-connect"
s.email = "andrewacove@gmail.com"
View
12 lib/authlogic_connect/oauth/tokens/oauth_token.rb
@@ -18,15 +18,23 @@ def oauth_version
def get(path, options = {})
config_options = self.class.send(:credentials)[:options]
- api_version = config_options[:api_version] unless config_options.nil?
+ unless config_options.nil?
+ api_version = config_options[:api_version]
+ user_agent = config_options[:user_agent]
+ end
path.insert(0, "/#{api_version}") unless api_version.nil?
+ options.reverse_merge!("User-Agent" => user_agent) unless user_agent.nil?
client.get(path, options)
end
def post(path, body='', headers ={})
config_options = self.class.send(:credentials)[:options]
- api_version = config_options[:api_version] unless config_options.nil?
+ unless config_options.nil?
+ api_version = config_options[:api_version]
+ user_agent = config_options[:user_agent]
+ end
path.insert(0, "/#{api_version}") unless api_version.nil?
+ headers.reverse_merge!("User-Agent" => user_agent) unless user_agent.nil?
client.post(path, body, headers)
end
Please sign in to comment.
Something went wrong with that request. Please try again.