mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 08:00:26 +00:00

In order for express (and possibly other libraries) to get and use the Http2ServerRequest/Response - expose them in the http2 exports. Same as is done in http module. PR-URL: https://github.com/nodejs/node/pull/14690 Ref: https://github.com/expressjs/express/issues/3390 Fixes: https://github.com/nodejs/node/issues/14672 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
20 lines
542 B
JavaScript
20 lines
542 B
JavaScript
// Flags: --expose-http2
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
const assert = require('assert');
|
|
const http2 = require('http2');
|
|
|
|
const {
|
|
Http2ServerRequest,
|
|
Http2ServerResponse,
|
|
} = http2;
|
|
|
|
const protoRequest = Object.create(Http2ServerRequest.prototype);
|
|
const protoResponse = Object.create(Http2ServerResponse.prototype);
|
|
|
|
assert.strictEqual(protoRequest instanceof Http2ServerRequest, true);
|
|
assert.strictEqual(protoResponse instanceof Http2ServerResponse, true);
|