diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-10-02 21:56:53 -0400 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2017-10-06 14:04:22 -0700 |
commit | 2da7d9b8207d9c35d199734da75fa2bb15f326b6 (patch) | |
tree | 9aa1ed51d29bc3d9241539e9ded4d0e4da951970 /test/parallel/test-http2-compat-serverrequest.js | |
parent | 4f339b54e9cd8a2cb69b41d87832ad8ca3a6b5e2 (diff) | |
download | android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.tar.gz android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.tar.bz2 android-node-v8-2da7d9b8207d9c35d199734da75fa2bb15f326b6.zip |
http2: near full http1 compatibility, add tests
Extensive re-work of http1 compatibility layer based on tests in
express, on-finished and finalhandler. Fix handling of HEAD
method to match http1. Adjust write, end, etc. to call writeHead
as in http1 and as expected by user-land modules. Add socket
proxy that instead uses the Http2Stream for the vast majority of
socket interactions. Add and change tests to closer represent
http1 behaviour.
Refs: https://github.com/nodejs/node/pull/15633
Refs: https://github.com/expressjs/express/tree/master/test
Refs: https://github.com/jshttp/on-finished/blob/master/test/test.js
Refs: https://github.com/pillarjs/finalhandler/blob/master/test/test.js
PR-URL: https://github.com/nodejs/node/pull/15702
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-compat-serverrequest.js')
-rw-r--r-- | test/parallel/test-http2-compat-serverrequest.js | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/test/parallel/test-http2-compat-serverrequest.js b/test/parallel/test-http2-compat-serverrequest.js index 31cc5ff4ef..edcd7a8f8c 100644 --- a/test/parallel/test-http2-compat-serverrequest.js +++ b/test/parallel/test-http2-compat-serverrequest.js @@ -19,9 +19,6 @@ server.listen(0, common.mustCall(function() { httpVersionMinor: 0 }; - assert.strictEqual(request.closed, false); - assert.strictEqual(request.code, h2.constants.NGHTTP2_NO_ERROR); - assert.strictEqual(request.httpVersion, expected.version); assert.strictEqual(request.httpVersionMajor, expected.httpVersionMajor); assert.strictEqual(request.httpVersionMinor, expected.httpVersionMinor); @@ -31,10 +28,8 @@ server.listen(0, common.mustCall(function() { assert.strictEqual(request.socket, request.connection); response.on('finish', common.mustCall(function() { - assert.strictEqual(request.closed, true); - assert.strictEqual(request.code, h2.constants.NGHTTP2_NO_ERROR); process.nextTick(() => { - assert.strictEqual(request.socket, undefined); + assert.ok(request.socket); server.close(); }); })); |