gerrit_util: work with all paths.

BUG=chromium:664664
TEST=local
  - Didn't work locally, now it does.

Change-Id: I5d470feda420342b0fb00a56e42a2b7d00257920
Reviewed-on: https://chromium-review.googlesource.com/411284
Reviewed-by: Aaron Gable <agable@chromium.org>
changes/84/411284/2
Dan Jacques 9 years ago committed by Daniel Jacques
parent 43906384aa
commit 6d5bcc2bb6

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

Loading…
Cancel
Save