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

Method createPushResponse

lib/internal/http2/compat.js:877–890  ·  view source on GitHub ↗
(headers, callback)

Source from the content-addressed store, hash-verified

875 }
876
877 createPushResponse(headers, callback) {
878 validateFunction(callback, 'callback');
879 if (this[kState].closed) {
880 process.nextTick(callback, new ERR_HTTP2_INVALID_STREAM());
881 return;
882 }
883 this[kStream].pushStream(headers, {}, (err, stream, headers, options) => {
884 if (err) {
885 callback(err);
886 return;
887 }
888 callback(null, new Http2ServerResponse(stream));
889 });
890 }
891
892 [kBeginSend]() {
893 const state = this[kState];

Calls 2

pushStreamMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected