(context, name, fn)
| 117 | |
| 118 | |
| 119 | function before(context, name, fn) { |
| 120 | var method = context[name]; |
| 121 | context[name] = function() { |
| 122 | fn.apply(this, arguments); |
| 123 | return method.apply(this, arguments); |
| 124 | }; |
| 125 | } |
| 126 | |
| 127 | before(io.engine, 'handleRequest', function(req, res) { |
| 128 | // echo a header value |