facebook/tornado — pull request #476 by birknilson (2012-03-09 17:40:03+00:00)
Title: Reduce complexity of StaticFileHandler.get()

This commit ensures StaticFileHandler.get() will delegate the handling of setting the header and body response to two new methods. This reduces the complexity of the initial method, but also eases subclassing of the class and the handling of how the GET response should be generated. The commit passes all the available tests.

My reason for doing this is mainly to make it easier to change how the response body is set. In a project where i use Mustache templates I need to retrieve a static resource called templates.json which will contain the contents of multiple templates which will be JSON encoded and allow me to utilize Mustache templates on the client-side without additional HTTP requests.