diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-31 23:22:40 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-31 23:22:40 +0300 |
commit | fc5df829bdbad7a47eae9ba1e14b55d3bb9ec39a (patch) | |
tree | 3dcfbc93427e2f19b2366bcebcb81e31914b564b | |
parent | dbef9f21511f1b06135763e93bac484d49c4d72c (diff) |
Use URI.join to avoid slash headaches
-rw-r--r-- | lib/bitbucket_server/connection.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |