(buf)
| 6216 | } |
| 6217 | onHeaderField(buf) { |
| 6218 | const len = this.headers.length; |
| 6219 | if ((len & 1) === 0) { |
| 6220 | this.headers.push(buf); |
| 6221 | } else { |
| 6222 | this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); |
| 6223 | } |
| 6224 | this.trackHeader(buf.length); |
| 6225 | } |
| 6226 | onHeaderValue(buf) { |
| 6227 | let len = this.headers.length; |
| 6228 | if ((len & 1) === 1) { |
| 6229 | this.headers.push(buf); |
| 6230 | len += 1; |
| 6231 | } else { |
| 6232 | this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]); |
| 6233 | } |
| 6234 | const key = this.headers[len - 2]; |
| 6235 | if (key.length === 10) { |
| 6236 | const headerName = util.bufferToLowerCasedHeaderName(key); |
| 6237 | if (headerName === "keep-alive") { |
| 6238 | this.keepAlive += buf.toString(); |
| 6239 | } else if (headerName === "connection") { |
| 6240 | this.connection += buf.toString(); |
| 6241 | } |
no test coverage detected