Index: chrome/common/extensions/docs/server/main.py |
diff --git a/chrome/common/extensions/docs/server/main.py b/chrome/common/extensions/docs/server/main.py |
index 854be76028e43537ba48f69fdade74d086e7de99..7131fd3930dce13765dea27b6b94a507d3e7835b 100755 |
--- a/chrome/common/extensions/docs/server/main.py |
+++ b/chrome/common/extensions/docs/server/main.py |
@@ -17,7 +17,7 @@ import app_known_issues |
DEFAULT_CACHE_TIME = 300 |
VIEW_VC_ROOT = 'http://src.chromium.org' |
- |
+CHROME_DOMAIN_URL = 'http://developer.chrome.com' |
class Channel(): |
def __init__(self, name, tag): |
@@ -180,6 +180,17 @@ class MainPage(webapp.RequestHandler): |
return self.redirectToIndexIfNecessary() |
+ def redirectDomain(self): |
+ if (self.request.url.startswith('http://code.google.com')): |
+ for channel in ['dev', 'beta', 'stable', 'trunk']: |
+ if channel in self.path: |
+ position = self.path.index(channel) |
+ self.path.pop(position) |
+ self.path.insert(0, channel) |
+ self.redirect(CHROME_DOMAIN_URL + '/' + '/'.join(self.path), True) |
+ return False |
+ |
+ |
def fetchContent(self): |
logging.info("fetching: %s" % str((self.branch, self.docFamily, self.path))) |
@@ -212,7 +223,8 @@ class MainPage(webapp.RequestHandler): |
if (not self.initPath() or |
not self.stripPathPrefix() or |
not self.initChannel() or |
- not self.initDocFamily()): |
+ not self.initDocFamily() or |
+ not self.redirectDomain()): |
return |
cacheKey = str((self.channel.name, self.docFamily, self.path)) |