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 <agable@chromium.org>
Commit-Queue: First Last <smut@chromium.org>
changes/21/410721/2
smut 9 years ago committed by Commit Bot
parent fda50ca02d
commit 43906384aa

@ -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)

Loading…
Cancel
Save