From ae1ed23421ffefa27fac765003cca41026bb971d Mon Sep 17 00:00:00 2001 From: Elias Torres Date: Wed, 3 Feb 2010 18:02:11 -0500 Subject: [PATCH] Making sure StaticFileHandlers get first, if not, a catch all handler would break the static handlers. --- tornado/web.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tornado/web.py b/tornado/web.py index 47dc3448..fd3bd5dd 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -909,12 +909,12 @@ class Application(object): handlers = list(handlers or []) static_url_prefix = settings.get("static_url_prefix", "/static/") - handlers.extend([ + handlers = [ (re.escape(static_url_prefix) + r"(.*)", StaticFileHandler, dict(path=path)), (r"/(favicon\.ico)", StaticFileHandler, dict(path=path)), (r"/(robots\.txt)", StaticFileHandler, dict(path=path)), - ]) + ] + handlers if handlers: self.add_handlers(".*$", handlers) # Automatically reload modified modules