MCPcopy Index your code
hub / github.com/nodejs/node / fillHeaders

Function fillHeaders

test/parallel/test-http-max-http-headers.js:32–43  ·  view source on GitHub ↗
(headers, currentSize, valid = false)

Source from the content-addressed store, hash-verified

30}
31
32function 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
45function writeHeaders(socket, headers) {
46 const array = [];

Callers 4

test1Function · 0.85
constructorMethod · 0.85
constructorMethod · 0.85

Calls 1

sliceMethod · 0.65

Tested by

no test coverage detected