code: function parseHeaders(raw_headers) {
    var headers = {},
        headers_split = raw_headers.split('\n');
  
    for (var i = 0; i < headers_split.length; i++) {
      var header = headers_split[i].split(':');
  
      if (header.length > 1) {
        var key = header.shift().trim();
        headers[key] = header.join(':').trim();
        continue;
      }
  
      if (header[1]) {
        headers[header[0].trim()] = header[1].trim();
      }
    }
    return headers;
  }
docs: Parse headers