summaryrefslogtreecommitdiff
path: root/app/models/project_services/jira_service.rb
diff options
context:
space:
mode:
authorHeinrich Lee Yu <heinrich@gitlab.com>2019-07-19 00:44:24 +0800
committerHeinrich Lee Yu <heinrich@gitlab.com>2019-07-22 13:35:52 +0800
commit589d1797d8dfdced2c6257597264bce0e2072c35 (patch)
treedd48ebd58932f2d2fab0725556db50298eea7aac /app/models/project_services/jira_service.rb
parent695f4bb17d157ba2c7653a6aefa9bf09ecc2c583 (diff)
downloadgitlab-ce-589d1797d8dfdced2c6257597264bce0e2072c35.tar.gz
Handle trailing slashes when generating Jira URLs63833-fix-jira-issues-url
Applies to issues_url and new_issue_url
Diffstat (limited to 'app/models/project_services/jira_service.rb')
-rw-r--r--app/models/project_services/jira_service.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/project_services/jira_service.rb b/app/models/project_services/jira_service.rb
index e571700fd02..7ab79242cc3 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, # Intended to find the root
- context_path: url.path.chomp('/'),
+ context_path: url.path,
auth_type: :basic,
read_timeout: 120,
use_cookies: true,
@@ -103,6 +103,12 @@ class JiraService < IssueTrackerService
"#{url}/secure/CreateIssue.jspa"
end
+ alias_method :original_url, :url
+
+ def url
+ original_url&.chomp('/')
+ end
+
def execute(push)
# This method is a no-op, because currently JiraService does not
# support any events.