mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
http: remove legacy parser
Remove the legacy `http_parser` implementation as a dependency and all code that uses it in favor of llhttp, given that the latter has been the default for all of Node 12 with no outstanding issues. PR-URL: https://github.com/nodejs/node/pull/29589 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
ba3be578d8
commit
ac59dc42ed
39 changed files with 99 additions and 8657 deletions
|
@ -10,7 +10,6 @@ const { getOptionValue } = require('internal/options');
|
|||
|
||||
console.log('pid is', process.pid);
|
||||
console.log('max header size is', getOptionValue('--max-http-header-size'));
|
||||
console.log('current http parser is', getOptionValue('--http-parser'));
|
||||
|
||||
// Verify that we cannot receive more than 8KB of headers.
|
||||
|
||||
|
@ -33,12 +32,8 @@ function finished(client, callback) {
|
|||
function fillHeaders(headers, currentSize, valid = false) {
|
||||
// `llhttp` counts actual header name/value sizes, excluding the whitespace
|
||||
// and stripped chars.
|
||||
if (getOptionValue('--http-parser') === 'llhttp') {
|
||||
// OK, Content-Length, 0, X-CRASH, aaa...
|
||||
headers += 'a'.repeat(MAX - currentSize);
|
||||
} else {
|
||||
headers += 'a'.repeat(MAX - headers.length - 3);
|
||||
}
|
||||
// OK, Content-Length, 0, X-CRASH, aaa...
|
||||
headers += 'a'.repeat(MAX - currentSize);
|
||||
|
||||
// Generate valid headers
|
||||
if (valid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue