Index: server/scripts/redirector.py |
diff --git a/server/scripts/redirector.py b/server/scripts/redirector.py |
index b19d01b429b45c2df3d748da70f715de91f0f2ac..e379228d1e0b3ee230fc52696674cee7d25b239c 100644 |
--- a/server/scripts/redirector.py |
+++ b/server/scripts/redirector.py |
@@ -298,6 +298,17 @@ def redir_bare_lib_name(handler, *args, **kwargs): |
# /1.12.0/dart-async => /1.12.0/dart-async/dart-async-library.html |
return '/%s/dart-%s/dart-%s-library.html' % (version, libname, libname) |
+# /dart_core.html => /stable/dart-core/dart-core-library.html |
+def redir_legacy_lib(handler, *args, **kwargs): |
+ libname = kwargs['libname'] |
+ return '/stable/dart-%s/dart-%s-library.html' % (libname, libname) |
+ |
+# /dart_core/Iterable.html => /stable/dart-core/Iterable-class.html |
+def redir_legacy_lib_class(handler, *args, **kwargs): |
+ libname = kwargs['libname'] |
+ classname = kwargs['classname'] |
+ return '/stable/dart-%s/%s-class.html' % (libname, classname) |
+ |
application = WSGIApplication( |
[ |
# Legacy URL redirection schemes. |
@@ -339,6 +350,12 @@ application = WSGIApplication( |
Route('/be/latest', RedirectHandler, |
defaults={'_uri': '/be'}), |
+ Route('/dart_<libname:[\w]+>.html', RedirectHandler, |
+ defaults={'_uri': redir_legacy_lib}), |
+ |
+ Route('/dart_<libname:[\w]+>/<classname:[\w]+>.html', RedirectHandler, |
+ defaults={'_uri': redir_legacy_lib_class}), |
+ |
# temp routing till stable docs are rolled out |
Route('/stable', RedirectHandler, |
defaults={'_uri': redir_stable_latest}), #ApiDocs), |