diff options
author | Rich Trott <rtrott@gmail.com> | 2017-08-26 12:28:07 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-08-26 13:13:17 -0700 |
commit | f912080bf2d8fd024d3443f3ab9e399bc84a724b (patch) | |
tree | 3e7788b04811297547de8edb4ea2c88f7352b7f9 /test/parallel/test-http2-respond-file-error-dir.js | |
parent | 99c478eb3629292e625a4d2fd634e89f0120ab91 (diff) | |
download | android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.tar.gz android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.tar.bz2 android-node-v8-f912080bf2d8fd024d3443f3ab9e399bc84a724b.zip |
Revert "http2: refactor error handling"
This reverts commit 4ca8ff264f368c301827e07956f313cebd1b8de8.
That commit was landed without a green CI and is failing on Windows.
PR-URL: https://github.com/nodejs/node/pull/15047
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-respond-file-error-dir.js')
-rw-r--r-- | test/parallel/test-http2-respond-file-error-dir.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/test/parallel/test-http2-respond-file-error-dir.js b/test/parallel/test-http2-respond-file-error-dir.js deleted file mode 100644 index 949ef2ffa4..0000000000 --- a/test/parallel/test-http2-respond-file-error-dir.js +++ /dev/null @@ -1,46 +0,0 @@ -// Flags: --expose-http2 -'use strict'; - -const common = require('../common'); -if (!common.hasCrypto) - common.skip('missing crypto'); -const http2 = require('http2'); -const assert = require('assert'); - -const { - HTTP2_HEADER_CONTENT_TYPE -} = http2.constants; - -const server = http2.createServer(); -server.on('stream', (stream) => { - stream.respondWithFile('../', { - [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain' - }, { - onError(err) { - common.expectsError({ - code: 'ERR_HTTP2_SEND_FILE', - type: Error, - message: 'Only regular files can be sent' - })(err); - - stream.respond({ ':status': 404 }); - stream.end(); - }, - statCheck: common.mustNotCall() - }); -}); -server.listen(0, () => { - - const client = http2.connect(`http://localhost:${server.address().port}`); - const req = client.request(); - - req.on('response', common.mustCall((headers) => { - assert.strictEqual(headers[':status'], 404); - })); - req.on('data', common.mustNotCall()); - req.on('end', common.mustCall(() => { - client.destroy(); - server.close(); - })); - req.end(); -}); |