in server/scripts/redirector.py [0:0]
def get_channel(self):
"""Quick accessor to examine a request and determine what channel
(be/beta/dev/stable) we're looking at. Return None if we have a weird
unexpected URL."""
parts = self.request.path.split('/')
if len(parts) > 0:
if len(parts) > 3 and self.request.path.startswith('/apidocs/channels/'):
channel = parts[3] # ['', 'apidocs', 'channels', '<channel>', ...]
else:
channel = parts[1] # ['', '<channel>', ...]
if channel in ApiDocs.latest_versions:
return channel
return None