code: function onHeaders (res, listener) {
    if (!res) {
      throw new TypeError('argument res is required')
    }
  
    if (typeof listener !== 'function') {
      throw new TypeError('argument listener must be a function')
    }
  
    res.writeHead = createWriteHead(res.writeHead, listener)
  }
docs: Execute a listener when a response is about to write headers.
  
  @param {object} res
  @return {function} listener
  @public