| 80 | } |
| 81 | |
| 82 | function Headers(headers) { |
| 83 | this.map = {}; |
| 84 | |
| 85 | if (headers instanceof Headers) { |
| 86 | headers.forEach(function (value, name) { |
| 87 | this.append(name, value); |
| 88 | }, this); |
| 89 | } else if (Array.isArray(headers)) { |
| 90 | headers.forEach(function (header) { |
| 91 | this.append(header[0], header[1]); |
| 92 | }, this); |
| 93 | } else if (headers) { |
| 94 | Object.getOwnPropertyNames(headers).forEach(function (name) { |
| 95 | this.append(name, headers[name]); |
| 96 | }, this); |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | Headers.prototype.append = function (name, value) { |
| 101 | name = normalizeName(name); |