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 /app/models/project_services/jira_service.rb | |
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 'app/models/project_services/jira_service.rb')
-rw-r--r-- | app/models/project_services/jira_service.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb index 5a38f48c542..9066a0b7f1d 100644 --- a/app/models/project_services/jira_service.rb +++ b/app/models/project_services/jira_service.rb @@ -54,7 +54,7 @@ class JiraService < IssueTrackerService { username: self.username, password: self.password, - site: URI.join(url, '/').to_s, + site: URI.join(url, '/').to_s, # Intended to find the root context_path: url.path.chomp('/'), auth_type: :basic, read_timeout: 120, |