Accessing response headers from NodeJS/ExpressJS before a response is sent

Is there a way to see which response headers will be present on an HTTP response (and possibly set new HTTP headers)? It seems like once res.send() or res.json() is called, ExpressJS takes over, and there is no way to "intercept" the response before it is sent to the client. Note that I've seen this asked and answered for different platforms, its just not clear whether this is possible in NodeJS/ExpressJS.

I ended up asking this on the ExpressJS issues board. The answer from dougwilson:

For both use-cases you listed, you want to alter/inspect the response headers. https://www.npmjs.org/package/on-headers is what you would use.

Source: https://github.com/strongloop/express/issues/2327