From 3ca336246dd64262827b92b9d197888ff37d9cfc Mon Sep 17 00:00:00 2001 From: pemontto Date: Mon, 27 Apr 2020 15:03:14 +0100 Subject: [PATCH] jira: Allow overriding https. --- zulip_bots/zulip_bots/bots/jira/jira.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/zulip_bots/zulip_bots/bots/jira/jira.py b/zulip_bots/zulip_bots/bots/jira/jira.py index 01da474..5d8b0e4 100644 --- a/zulip_bots/zulip_bots/bots/jira/jira.py +++ b/zulip_bots/zulip_bots/bots/jira/jira.py @@ -127,7 +127,12 @@ class JiraHandler: raise KeyError('No `domain` was specified') self.auth = make_jira_auth(username, password) - self.domain_with_protocol = 'https://' + domain + + # Allow users to override the HTTP scheme + if re.match(r'^https?://', domain, re.IGNORECASE): + self.domain_with_protocol = domain + else: + self.domain_with_protocol = 'https://' + domain def handle_message(self, message: Dict[str, str], bot_handler: Any) -> None: content = message.get('content')