There might be a compatibility issue here with using this middleware in [goliath](https://github.com/postrank-labs/goliath/wiki/Middleware#writing-your-own-middleware). Once you start modifying the response you have to think about it...