mirror of https://github.com/lukechilds/node.git
Browse Source
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>canary-base
Pini Houri
7 years ago
committed by
Benjamin Gruenbaum
4 changed files with 37 additions and 5 deletions
@ -0,0 +1,19 @@ |
|||||
|
// 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); |
Loading…
Reference in new issue