MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / onHeaderValue

Method onHeaderValue

out/cli.cjs:54284–54301  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

54282 const len = this.headers.length;
54283 if ((len & 1) === 0) {
54284 this.headers.push(buf);
54285 } else {
54286 this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
54287 }
54288 this.trackHeader(buf.length);
54289 }
54290 onHeaderValue(buf) {
54291 let len = this.headers.length;
54292 if ((len & 1) === 1) {
54293 this.headers.push(buf);
54294 len += 1;
54295 } else {
54296 this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);
54297 }
54298 const key = this.headers[len - 2];
54299 if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") {
54300 this.keepAlive += buf.toString();
54301 } else if (key.length === 10 && key.toString().toLowerCase() === "connection") {
54302 this.connection += buf.toString();
54303 } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") {
54304 this.contentLength += buf.toString();

Callers 1

lazyllhttpFunction · 0.80

Calls 5

concatMethod · 0.80
toLowerCaseMethod · 0.80
trackHeaderMethod · 0.80
pushMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected