in server/scripts/redirector.py [0:0]
def resolve_doc_path(self, channel):
"""Given the request URL, determine what specific docs version we should
actually display."""
path = None
if channel:
length = len(channel) + 2
else:
length = 1
postfix = self.request.path[length:]
index = postfix.find('/')
if index != -1:
version_num = postfix[:index]
postfix = postfix[index+1:]
if postfix.startswith('/'):
postfix = postfix[1:]
else:
if channel:
version_num = self.get_latest_version(channel)
else:
channel = 'stable'
version_num = self.get_latest_version(channel)
postfix = 'index.html'
path = self.build_gcs_path(version_num, postfix, channel)
logging.debug('build_gcs_path("%s", "%s", "%s") -> "%s"'
% (version_num, postfix, channel, path))
return path