(headers)
| 54 | } |
| 55 | |
| 56 | function hasHostHeader (headers) { |
| 57 | if (headers == null) { |
| 58 | return false |
| 59 | } |
| 60 | |
| 61 | if (Array.isArray(headers)) { |
| 62 | if (headers.length === 0) { |
| 63 | return false |
| 64 | } |
| 65 | |
| 66 | for (let i = 0; i < headers.length; i += 2) { |
| 67 | if (isHostHeader(headers[i])) { |
| 68 | return true |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | return false |
| 73 | } |
| 74 | |
| 75 | if (typeof headers === 'object') { |
| 76 | for (const key in headers) { |
| 77 | if (isHostHeader(key)) { |
| 78 | return true |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | return false |
| 84 | } |
| 85 | |
| 86 | function withHostHeader (host, headers) { |
| 87 | const normalizedHeaders = normalizeHeaders(headers) |
no test coverage detected