Set url scheme on HTTP Gerrit events

When getting additional change data from the Gerrit HTTP api we weren't
setting the scheme on the resulting change.url value. This resulted in
urls without a scheme which browsers would treat as relative path
components. Fix this by setting a scheme based on the connection
baseurl.

Change-Id: I9e907c79fa531d15c80e593ca7f7cebc5c516165
This commit is contained in:
Clark Boylan 2019-10-01 14:46:50 -07:00
parent 27579ce456
commit 8f59afeaa7
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ class GerritChange(Change):
self.project = connection.source.getProject(data['project'])
self.id = data['change_id']
self.branch = data['branch']
self.url = '%s/%s' % (baseurl, self.number)
self.url = '%s://%s/%s' % (urlparse.scheme, baseurl, self.number)
self.uris = [
'%s/%s' % (baseurl, self.number),
'%s/#/c/%s' % (baseurl, self.number),