diff options
author | rockot <rockot@chromium.org> | 2014-11-07 20:21:31 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-08 04:22:39 +0000 |
commit | 716e3d4ff653c05e7002bd235d793d0dec4f53e4 (patch) | |
tree | f233637bce0dfccb264ab4e62caaf8599873122d | |
parent | e134ba22e9cdd7dc82bfe13570270bd1e0d99552 (diff) | |
download | chromium_src-716e3d4ff653c05e7002bd235d793d0dec4f53e4.zip chromium_src-716e3d4ff653c05e7002bd235d793d0dec4f53e4.tar.gz chromium_src-716e3d4ff653c05e7002bd235d793d0dec4f53e4.tar.bz2 |
Docserver: Disable gerrit auth on dev server.
This prevents the auth prefix from being injected into
gerrit request URLs within the development server.
BUG=None
R=kalman@chromium.org
NOTRY=True
Review URL: https://codereview.chromium.org/709133002
Cr-Commit-Position: refs/heads/master@{#303375}
-rw-r--r-- | chrome/common/extensions/docs/server2/gitiles_file_system.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/common/extensions/docs/server2/gitiles_file_system.py b/chrome/common/extensions/docs/server2/gitiles_file_system.py index ba55931..ecfd78c 100644 --- a/chrome/common/extensions/docs/server2/gitiles_file_system.py +++ b/chrome/common/extensions/docs/server2/gitiles_file_system.py @@ -14,6 +14,7 @@ import traceback from appengine_url_fetcher import AppEngineUrlFetcher from appengine_wrappers import IsDownloadError, app_identity from docs_server_utils import StringIdentity +from environment import IsDevServer from file_system import (FileNotFoundError, FileSystem, FileSystemError, @@ -65,7 +66,10 @@ class GitilesFileSystem(FileSystem): logging.info('Got token %s for scope %s' % (token, GITILES_OAUTH2_SCOPE)) cls._logged_tokens.add(token) - path_prefix = '' if token is None else _AUTH_PATH_PREFIX + # Only include forced-auth (/a/) in the Gitiles URL if we have a token and + # this is not the development server. + path_prefix = ('' if token is None or IsDevServer() + else _AUTH_PATH_PREFIX) if commit: base_url = '%s%s/%s/%s' % ( GITILES_BASE, path_prefix, GITILES_SRC_ROOT, commit) |