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

Function matchHeader

lib/_http_outgoing.js:609–642  ·  view source on GitHub ↗
(self, state, field, value)

Source from the content-addressed store, hash-verified

607}
608
609function matchHeader(self, state, field, value) {
610 if (field.length < 4 || field.length > 17)
611 return;
612 field = field.toLowerCase();
613 switch (field) {
614 case 'connection':
615 state.connection = true;
616 self._removedConnection = false;
617 if (RE_CONN_CLOSE.test(value))
618 self._last = true;
619 else
620 self.shouldKeepAlive = true;
621 break;
622 case 'transfer-encoding':
623 state.te = true;
624 self._removedTE = false;
625 if (RE_TE_CHUNKED.test(value))
626 self.chunkedEncoding = true;
627 break;
628 case 'content-length':
629 state.contLen = true;
630 self._contentLength = +value;
631 self._removedContLen = false;
632 break;
633 case 'date':
634 case 'expect':
635 case 'trailer':
636 state[field] = true;
637 break;
638 case 'keep-alive':
639 self._defaultKeepAlive = false;
640 break;
641 }
642}
643
644const validateHeaderName = assignFunctionName('validateHeaderName', hideStackFrames((name, label) => {
645 if (typeof name !== 'string' || !name || !checkIsHttpToken(name)) {

Callers 1

storeHeaderFunction · 0.85

Calls 1

testMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…