function processHeaders(headers) {
    var res = {
      count: 0,
      size: 0,
    };

    if (headers) {
      Object.keys(headers).forEach(function (key) {
        res.count++;
        res.size += (key + ": " + headers[key] + "\r\n").length;
      });
    }

    return res;
  }
Analyzes HTTP headers in both requests and responses