From 43906384aa4afb45703b75eecd771253d588f042 Mon Sep 17 00:00:00 2001 From: smut Date: Fri, 11 Nov 2016 17:03:29 -0800 Subject: [PATCH] Fix authorization support The path always starts with a / so we need to check if it starts with /a/ to see if it's already authorized, not a/. BUG=664664 Change-Id: I2bf6abe36dd88bc7d096e67d5e7a56fe9f143f47 Reviewed-on: https://chromium-review.googlesource.com/410721 Reviewed-by: Aaron Gable Commit-Queue: First Last --- gerrit_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gerrit_util.py b/gerrit_util.py index 6ea57f5a8..a433e83dc 100755 --- a/gerrit_util.py +++ b/gerrit_util.py @@ -266,10 +266,10 @@ 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 + if 'Authorization' in headers and not path.startswith('/a/'): + url = '/a%s' % path else: - url = '/%s' % path + url = '%s' % path if body: body = json.JSONEncoder().encode(body)