MCPcopy Create free account
hub / github.com/angular/dev-infra / onBody

Method onBody

github-actions/browserstack/set-browserstack-env.js:6359–6381  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

6357 const { client, socket, headers, statusText } = this;
6358 if (socket.destroyed) {
6359 return -1;
6360 }
6361 if (client[kRunning] === 0) {
6362 util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
6363 return -1;
6364 }
6365 const request = client[kQueue][client[kRunningIdx]];
6366 if (!request) {
6367 return -1;
6368 }
6369 assert(!this.upgrade);
6370 assert(this.statusCode < 200);
6371 if (statusCode === 100) {
6372 util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));
6373 return -1;
6374 }
6375 if (upgrade && !request.upgrade) {
6376 util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket)));
6377 return -1;
6378 }
6379 assert(this.timeoutType === TIMEOUT_HEADERS);
6380 this.statusCode = statusCode;
6381 this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.
6382 request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive";
6383 if (this.statusCode >= 200) {
6384 const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout];

Callers 1

lazyllhttpFunction · 0.45

Calls 3

refreshMethod · 0.45
destroyMethod · 0.45
onDataMethod · 0.45

Tested by

no test coverage detected