Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/linked_in/helpers/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def parse_oauth_options
:request_token_url => full_oauth_url_for(:request_token, :api_host),
:access_token_url => full_oauth_url_for(:access_token, :api_host),
:authorize_url => full_oauth_url_for(:authorize, :auth_host),
:site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host]
:site => @consumer_options[:site] || @consumer_options[:api_host] || DEFAULT_OAUTH_OPTIONS[:api_host],
:proxy => @consumer_options.fetch(:proxy, nil)
}
end

Expand Down
13 changes: 13 additions & 0 deletions spec/cases/oauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
end
end

describe "proxy oauth options" do
let(:proxy) { "http://dummy.proxy" }
let(:consumer) do
LinkedIn::Client.new('1234', '1234', {
:proxy => proxy,
}).consumer
end

it "should send requests though proxy" do
consumer.proxy.should eq proxy
end
end

describe "different api and auth hosts options" do
let(:consumer) do
LinkedIn::Client.new('1234', '1234', {
Expand Down