From: Elias Torres Date: Wed, 3 Feb 2010 23:02:11 +0000 (-0500) Subject: Making sure StaticFileHandlers get first, if not, a catch all handler would break... X-Git-Tag: v1.0.0~76^2~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae1ed23421ffefa27fac765003cca41026bb971d;p=thirdparty%2Ftornado.git Making sure StaticFileHandlers get first, if not, a catch all handler would break the static handlers. --- diff --git a/tornado/web.py b/tornado/web.py index 47dc34486..fd3bd5dd0 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