Skip to content

Commit 745b775

Browse files
committed
Add url key to env hash with a URI value
1 parent f2f3899 commit 745b775

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/bitbucket_rest_api/request/oauth.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,19 @@ class OAuth < Faraday::Middleware
1313

1414
def call(env)
1515
# Extract parameters from the query
16+
request = Rack::Request.new env
17+
env[:url] = URI.parse(request.url) if env[:url].nil?
1618
params = { }.update query_params(env[:url])
1719

1820
if (@token and @secret) and (!@token.empty? and !@secret.empty?)
1921
access_token = ::OAuth::AccessToken.new(@consumer, @token, @secret)
2022
env[:url].query = build_query params
21-
23+
2224
puts oauth_helper.header
2325
puts oauth_helper.header.class
2426
env[:request_headers].merge!(AUTH_HEADER => oauth_helper.header)
2527
end
26-
28+
2729
env[:url].query = build_query params
2830

2931

0 commit comments

Comments
 (0)