From fc5df829bdbad7a47eae9ba1e14b55d3bb9ec39a Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 31 Jul 2018 13:22:40 -0700 Subject: Use URI.join to avoid slash headaches --- lib/bitbucket_server/connection.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/bitbucket_server') diff --git a/lib/bitbucket_server/connection.rb b/lib/bitbucket_server/connection.rb index e100d8bde1c..a43b4364cab 100644 --- a/lib/bitbucket_server/connection.rb +++ b/lib/bitbucket_server/connection.rb @@ -87,16 +87,16 @@ module BitbucketServer def build_url(path) return path if path.starts_with?(root_url) - "#{root_url}#{path}" + URI.join(root_url, path).to_s end def root_url - "#{base_uri}/rest/api/#{api_version}" + URI.join(base_uri, "/rest/api/#{api_version}").to_s end def delete_url(resource, path) if resource == :branches - "#{base_uri}/rest/branch-utils/#{api_version}#{path}" + URI.join(base_uri, "/rest/branch-utils/#{api_version}#{path}").to_s else build_url(path) end -- cgit v1.2.1