From: Ben Darnell Date: Sat, 4 Jan 2014 16:33:50 +0000 (-0500) Subject: Add a warning to the StaticFileHandler docs against overriding .get(). X-Git-Tag: v3.2.0b2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48a5969c3099938ff558a1f5671c8cf89fc323a7;p=thirdparty%2Ftornado.git Add a warning to the StaticFileHandler docs against overriding .get(). --- diff --git a/tornado/web.py b/tornado/web.py index 7d29c3834..b22b11fe6 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -1854,6 +1854,11 @@ class StaticFileHandler(RequestHandler): class method. Instance methods may use the attributes ``self.path`` ``self.absolute_path``, and ``self.modified``. + Subclasses should only override methods discussed in this section; + overriding other methods is error-prone. Overriding + ``StaticFileHandler.get`` is particularly problematic due to the + tight coupling with ``compute_etag`` and other methods. + To change the way static urls are generated (e.g. to match the behavior of another server or CDN), override `make_static_url`, `parse_url_path`, `get_cache_time`, and/or `get_version`.