diff options
author | Stan Hu <stanhu@gmail.com> | 2018-11-09 15:31:26 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-11-09 15:36:45 -0800 |
commit | 39f252254b535e58fe50e722a4ba5d95b17fc90d (patch) | |
tree | dd7312cab3c2f07247112c852ea92c205a21c2c0 /app/helpers | |
parent | 4aa41d07e16ca03f5f56b7cc5c136d86d51666c2 (diff) | |
download | gitlab-ce-39f252254b535e58fe50e722a4ba5d95b17fc90d.tar.gz |
Make sure there's only one slash as path separatorsh-53180-append-path
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 'app/helpers')
-rw-r--r-- | app/helpers/import_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/import_helper.rb b/app/helpers/import_helper.rb index 3d0eb3d0d51..49171df1433 100644 --- a/app/helpers/import_helper.rb +++ b/app/helpers/import_helper.rb @@ -83,7 +83,7 @@ module ImportHelper private def github_project_url(full_path) - URI.join(github_root_url, full_path).to_s + Gitlab::Utils.append_path(github_root_url, full_path) end def github_root_url @@ -95,6 +95,6 @@ module ImportHelper end def gitea_project_url(full_path) - URI.join(@gitea_host_url, full_path).to_s + Gitlab::Utils.append_path(@gitea_host_url, full_path) end end |