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

Side by Side Diff: chrome/common/extensions/docs/server2/handler.py

Issue 15087006: Docserver: there is only one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better redirects Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 from branch_utility import BranchUtility 5 from branch_utility import BranchUtility
6 from cron_servlet import CronServlet 6 from cron_servlet import CronServlet
7 from patch_servlet import PatchServlet 7 from patch_servlet import PatchServlet
8 from instance_servlet import InstanceServlet 8 from instance_servlet import InstanceServlet
9 from servlet import Servlet, Request, Response 9 from servlet import Servlet, Request, Response
10 10
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 new_host = 'http://developer.chrome.com' 57 new_host = 'http://developer.chrome.com'
58 58
59 # switch to https if necessary 59 # switch to https if necessary
60 if host.startswith('https'): 60 if host.startswith('https'):
61 new_host = new_host.replace('http', 'https', 1) 61 new_host = new_host.replace('http', 'https', 1)
62 62
63 new_path = path.split('/') 63 new_path = path.split('/')
64 if len(new_path) > 0 and new_path[0] == 'chrome': 64 if len(new_path) > 0 and new_path[0] == 'chrome':
65 new_path.pop(0) 65 new_path.pop(0)
66 # We don't do multi channel anymore, but leave this code around for legacy.
66 for channel in BranchUtility.GetAllChannelNames(): 67 for channel in BranchUtility.GetAllChannelNames():
67 if channel in new_path: 68 if channel in new_path:
68 position = new_path.index(channel) 69 position = new_path.index(channel)
69 new_path.pop(position) 70 new_path.pop(position)
70 new_path.insert(0, channel) 71 new_path.insert(0, channel)
71 return Response.Redirect('/'.join([new_host] + new_path)) 72 return Response.Redirect('/'.join([new_host] + new_path))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698