well, that's not quite all. if you're writing middleware you sometimes have to write a some (mostly reusable) extra code to pass as the start_response() to other wsgi callables. (to access the headers and/or munge anything sent by .write() -- or disallow .write() entirely).