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

Function test

test/parallel/test-http-response-splitting.js:24–34  ·  view source on GitHub ↗
(res, code, key, value)

Source from the content-addressed store, hash-verified

22const countdown = new Countdown(3, () => server.close());
23
24function test(res, code, key, value) {
25 const header = { [key]: value };
26 assert.throws(
27 () => res.writeHead(code, header),
28 {
29 code: 'ERR_INVALID_CHAR',
30 name: 'TypeError',
31 message: `Invalid character in header content ["${key}"]`
32 }
33 );
34}
35
36const server = http.createServer((req, res) => {
37 switch (count++) {

Callers 1

Calls 1

writeHeadMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…