Making sure StaticFileHandlers get first, if not, a catch all handler would break the static handlers.

This commit is contained in:
Elias Torres 2010-02-03 18:02:11 -05:00 committed by Ben Darnell
parent 3e9a285af0
commit ae1ed23421
1 changed files with 2 additions and 2 deletions

View File

@ -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