diff options
author | Robert Nagy <ronagy@icloud.com> | 2019-05-30 20:24:12 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-10-13 19:04:44 -0700 |
commit | 5f80df882057522c38c30b99f4bf25d82c68f662 (patch) | |
tree | 608f8e77510cb4b029f02cfc2ff735688f1fe3d2 /test/parallel/test-http-header-overflow.js | |
parent | 4ca61f40fed31d590e4d624551044fe7cc7efd42 (diff) | |
download | android-node-v8-5f80df882057522c38c30b99f4bf25d82c68f662.tar.gz android-node-v8-5f80df882057522c38c30b99f4bf25d82c68f662.tar.bz2 android-node-v8-5f80df882057522c38c30b99f4bf25d82c68f662.zip |
http: do not emit end after aborted
IncomingMessage will no longer emit end after aborted.
PR-URL: https://github.com/nodejs/node/pull/27984
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-http-header-overflow.js')
-rw-r--r-- | test/parallel/test-http-header-overflow.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/parallel/test-http-header-overflow.js b/test/parallel/test-http-header-overflow.js index 83a2d46910..1d39a7fd8b 100644 --- a/test/parallel/test-http-header-overflow.js +++ b/test/parallel/test-http-header-overflow.js @@ -1,9 +1,13 @@ +// Flags: --expose-internals + 'use strict'; const { expectsError, mustCall } = require('../common'); const assert = require('assert'); const { createServer, maxHeaderSize } = require('http'); const { createConnection } = require('net'); +const { getOptionValue } = require('internal/options'); + const CRLF = '\r\n'; const DUMMY_HEADER_NAME = 'Cookie: '; const DUMMY_HEADER_VALUE = 'a'.repeat( @@ -17,11 +21,14 @@ const PAYLOAD = PAYLOAD_GET + CRLF + const server = createServer(); server.on('connection', mustCall((socket) => { + // Legacy parser gives sligthly different response. + // This discripancy is not fixed on purpose. + const legacy = getOptionValue('--http-parser') === 'legacy'; socket.on('error', expectsError({ type: Error, message: 'Parse Error: Header overflow', code: 'HPE_HEADER_OVERFLOW', - bytesParsed: maxHeaderSize + PAYLOAD_GET.length, + bytesParsed: maxHeaderSize + PAYLOAD_GET.length - (legacy ? -1 : 0), rawPacket: Buffer.from(PAYLOAD) })); })); |