Commit fc5df829 authored by Stan Hu's avatar Stan Hu

Use URI.join to avoid slash headaches

parent dbef9f21
...@@ -87,16 +87,16 @@ module BitbucketServer ...@@ -87,16 +87,16 @@ module BitbucketServer
def build_url(path) def build_url(path)
return path if path.starts_with?(root_url) return path if path.starts_with?(root_url)
"#{root_url}#{path}" URI.join(root_url, path).to_s
end end
def root_url def root_url
"#{base_uri}/rest/api/#{api_version}" URI.join(base_uri, "/rest/api/#{api_version}").to_s
end end
def delete_url(resource, path) def delete_url(resource, path)
if resource == :branches if resource == :branches
"#{base_uri}/rest/branch-utils/#{api_version}#{path}" URI.join(base_uri, "/rest/branch-utils/#{api_version}#{path}").to_s
else else
build_url(path) build_url(path)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment