diff options
author | Stan Hu <stanhu@gmail.com> | 2018-11-10 02:31:26 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-11-10 02:36:45 +0300 |
commit | 39f252254b535e58fe50e722a4ba5d95b17fc90d (patch) | |
tree | dd7312cab3c2f07247112c852ea92c205a21c2c0 /lib/gitlab/middleware | |
parent | 4aa41d07e16ca03f5f56b7cc5c136d86d51666c2 (diff) |
Make sure there's only one slash as path separator
In Ruby 2.4, `URI.join("http://test//", "a").to_s` will
remove the double slash, however it's not the case in
Ruby 2.5. Using chomp should work better for the intention,
as we're not trying to allow things like ../ or / paths
resolution.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/53180
Diffstat (limited to 'lib/gitlab/middleware')
-rw-r--r-- | lib/gitlab/middleware/go.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/middleware/go.rb b/lib/gitlab/middleware/go.rb index 1fd8f147b44..6943567fb6d 100644 --- a/lib/gitlab/middleware/go.rb +++ b/lib/gitlab/middleware/go.rb @@ -38,7 +38,7 @@ module Gitlab def go_body(path) config = Gitlab.config - project_url = URI.join(config.gitlab.url, path) + project_url = Gitlab::Utils.append_path(config.gitlab.url, path) import_prefix = strip_url(project_url.to_s) repository_url = if Gitlab::CurrentSettings.enabled_git_access_protocol == 'ssh' |