postrank-labs/goliath-contrib — pull request #2 by mrflip (2012-06-24 06:15:40+00:00)
Title: Utility middlewares

Middlewares to do many useful forms of diagnosis and fault injection:

* force_delay does a 'sleep for x +- y' seconds before responding
* force_drop drops the connection, before or after its middleware descendents run
* force_fault raises the requested type of error (eg _fault=404 will bail out of the rpocessing chain, returning a 404 Not Found response
* force_response forcibly replaces the status, headers or body with what's given in the URL
* handle_exceptions gives you response methods, same that the middleware provides, for your app
* diagnostics recycles info about the request into the output

I don't seem to know how to do these as individual pull requests