code: function (headers) {
        var parsed = {};
  
        if (headers) {
          headers = headers.trim().split("\n");
          for (var h in headers) {
            if (headers.hasOwnProperty(h)) {
              var header = headers[h].match(/([^:]+):(.*)/);
              parsed[header[1].trim().toLowerCase()] = header[2].trim();
            }
          }
        }
        return parsed;
      }
docs: XMLHttpRequest returns a not very usable single big string with all headers