Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: appengine_mapper.py

Issue 2431893002: Automatically map urls to their raw appengine forms (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/upload.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine_mapper.py
diff --git a/appengine_mapper.py b/appengine_mapper.py
new file mode 100644
index 0000000000000000000000000000000000000000..ddb8e6a13d15abe2a2ad1434d49a9eebb9f35956
--- /dev/null
+++ b/appengine_mapper.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Ensures that all depot_tools talks directly to appengine to avoid SNI."""
+
+import urlparse
+
+
+mapping = {
+ 'codereview.chromium.org': 'chromiumcodereview.appspot.com',
+ 'crashpad.chromium.org': 'crashpad-home.appspot.com',
+ 'bugs.chromium.org': 'monorail-prod.appspot.com',
+ 'bugs-staging.chromium.org': 'monorail-staging.appspot.com',
+}
+
+
+def MapUrl(url):
+ parts = list(urlparse.urlsplit(url))
+ new_netloc = mapping.get(parts[1])
+ if new_netloc:
+ parts[1] = new_netloc
+ return urlparse.urlunsplit(parts)
« no previous file with comments | « no previous file | third_party/upload.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698