diff --git a/gerrit_util.py b/gerrit_util.py index a433e83dc..0c73785e2 100755 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -266,10 +266,11 @@ def CreateHttpConn(host, path, reqtype='GET', headers=None, body=None): else: LOGGER.debug('No authorization found for %s.' % bare_host) - if 'Authorization' in headers and not path.startswith('/a/'): - url = '/a%s' % path - else: - url = '%s' % path + url = path + if not url.startswith('/'): + url = '/' + url + if 'Authorization' in headers and not url.startswith('/a/'): + url = '/a%s' % url if body: body = json.JSONEncoder().encode(body)