(headers, currentSize, valid = false)
| 30 | } |
| 31 | |
| 32 | function fillHeaders(headers, currentSize, valid = false) { |
| 33 | // `llhttp` counts actual header name/value sizes, excluding the whitespace |
| 34 | // and stripped chars. |
| 35 | // OK, Content-Length, 0, X-CRASH, aaa... |
| 36 | headers += 'a'.repeat(MAX - currentSize); |
| 37 | |
| 38 | // Generate valid headers |
| 39 | if (valid) { |
| 40 | headers = headers.slice(0, -1); |
| 41 | } |
| 42 | return headers + '\r\n\r\n'; |
| 43 | } |
| 44 | |
| 45 | function writeHeaders(socket, headers) { |
| 46 | const array = []; |
no test coverage detected