diff options
author | Fedor Indutny <fedor@indutny.com> | 2018-11-20 23:33:49 -0500 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2018-11-28 11:36:34 +1100 |
commit | af8d9e3972bba423ab0027239062b894030db5c7 (patch) | |
tree | b02210f3b78efad26442649a03ec9ee0405b4ec1 /test/sequential | |
parent | f413f7c9cf5749c231c4b4e667dc2cbab959dd59 (diff) | |
download | android-node-v8-af8d9e3972bba423ab0027239062b894030db5c7.tar.gz android-node-v8-af8d9e3972bba423ab0027239062b894030db5c7.tar.bz2 android-node-v8-af8d9e3972bba423ab0027239062b894030db5c7.zip |
http: fix header limit errors and test for llhttp
Ref: https://github.com/nodejs-private/node-private/pull/143
PR-URL: https://github.com/nodejs-private/node-private/pull/149
Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'test/sequential')
-rw-r--r-- | test/sequential/test-http-max-http-headers.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/sequential/test-http-max-http-headers.js b/test/sequential/test-http-max-http-headers.js index 155b75fb07..5ca27a0d17 100644 --- a/test/sequential/test-http-max-http-headers.js +++ b/test/sequential/test-http-max-http-headers.js @@ -25,6 +25,15 @@ function finished(client, callback) { } function fillHeaders(headers, currentSize, valid = false) { + // llhttp counts actual header name/value sizes, excluding the whitespace and + // stripped chars. + if (process.versions.hasOwnProperty('llhttp')) { + // OK, Content-Length, 0, X-CRASH, aaa... + headers += 'a'.repeat(MAX - currentSize); + } else { + headers += 'a'.repeat(MAX - headers.length - 3); + } + // Generate valid headers if (valid) { // TODO(mcollina): understand why -9 is needed instead of -1 |