(headerText = '')
| 128 | } |
| 129 | |
| 130 | function parseRawHeaders(headerText = '') { |
| 131 | const headers = {}; |
| 132 | const lines = String(headerText || '').split('\n'); |
| 133 | let currentName = ''; |
| 134 | |
| 135 | for (const line of lines) { |
| 136 | if (!line) continue; |
| 137 | if ((line.startsWith(' ') || line.startsWith('\t')) && currentName) { |
| 138 | headers[currentName] += ` ${line.trim()}`; |
| 139 | continue; |
| 140 | } |
| 141 | |
| 142 | const separatorIndex = line.indexOf(':'); |
| 143 | if (separatorIndex <= 0) continue; |
| 144 | currentName = line.slice(0, separatorIndex).trim().toLowerCase(); |
| 145 | headers[currentName] = line.slice(separatorIndex + 1).trim(); |
| 146 | } |
| 147 | |
| 148 | return headers; |
| 149 | } |
| 150 | |
| 151 | function decodeMimeEncodedWords(value = '') { |
| 152 | const source = String(value || ''); |
no outgoing calls
no test coverage detected