mcavage/node-restify — pull request #133 by pbouzakis (2012-04-25 15:14:55+00:00)
Title: adds beforeSend event

emit in response.send before default headers are sent and when we know the body response data

needed a hook that let us send headers as soon as we know the body response. without this, the pre hook was too early, after hook to late, and plugins early/late.

use case for us was to create an ETag header on all 200 requests that return JSON. We md5 the response object. So we need ability to send header and obtain the body response.