(headers, optionName)
| 174 | |
| 175 | // https://tools.ietf.org/html/rfc7231#section-6.4 |
| 176 | function normalizeStripHeaders (headers, optionName) { |
| 177 | if (headers == null) { |
| 178 | return null |
| 179 | } |
| 180 | |
| 181 | if (!Array.isArray(headers)) { |
| 182 | throw new InvalidArgumentError(`${optionName} must be an array`) |
| 183 | } |
| 184 | |
| 185 | const normalized = new Set() |
| 186 | for (const header of headers) { |
| 187 | if (typeof header !== 'string') { |
| 188 | throw new InvalidArgumentError(`${optionName} must contain header names`) |
| 189 | } |
| 190 | |
| 191 | normalized.add(util.headerNameToString(header)) |
| 192 | } |
| 193 | return normalized |
| 194 | } |
| 195 | |
| 196 | function cleanRequestHeaders (headers, removeContent, unknownOrigin, stripHeaders, stripHeadersOnCrossOrigin) { |
| 197 | const ret = [] |
no test coverage detected
searching dependent graphs…