Restore the header size limit of 80 KB

Fixes #10849.
This commit is contained in:
Tim van der Meij 2019-06-29 13:23:43 +02:00
parent 2800962285
commit 95285cb590
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -122,6 +122,16 @@ function safeSpawnSync(command, parameters, options) {
return result;
}
function startNode(args, options) {
// Node.js decreased the maximum header size from 80 KB to 8 KB in newer
// releases, which is not sufficient for some of our reference test files
// (such as `issue6360.pdf`), so we need to restore this value. Note that
// this argument needs to be before all other arguments as it needs to be
// passed to the Node.js process itself and not to the script that it runs.
args.unshift('--max-http-header-size=80000');
return spawn('node', args, options);
}
function createStringSource(filename, content) {
var source = stream.Readable({ objectMode: true, });
source._read = function () {
@ -405,7 +415,7 @@ function createTestSource(testsName, bot) {
args.push('--strictVerify');
}
var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', });
testProcess.on('close', function (code) {
source.push(null);
});
@ -435,7 +445,7 @@ function makeRef(done, bot) {
args.push('--noPrompts', '--strictVerify');
}
args.push('--browserManifestFile=' + PDF_BROWSERS);
var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', });
testProcess.on('close', function (code) {
done();
});
@ -1146,7 +1156,7 @@ gulp.task('baseline', function (done) {
gulp.task('unittestcli', gulp.series('testing-pre', 'lib', function(done) {
var options = ['node_modules/jasmine/bin/jasmine',
'JASMINE_CONFIG_PATH=test/unit/clitests.json'];
var jasmineProcess = spawn('node', options, { stdio: 'inherit', });
var jasmineProcess = startNode(options, { stdio: 'inherit', });
jasmineProcess.on('close', function(code) {
if (code !== 0) {
done(new Error('Unit tests failed.'));
@ -1163,7 +1173,7 @@ gulp.task('lint', gulp.series('default_preferences', function(done) {
// Ensure that we lint the Firefox specific *.jsm files too.
var options = ['node_modules/eslint/bin/eslint', '--ext', '.js,.jsm', '.',
'--report-unused-disable-directives'];
var esLintProcess = spawn('node', options, { stdio: 'inherit', });
var esLintProcess = startNode(options, { stdio: 'inherit', });
esLintProcess.on('close', function (code) {
if (code !== 0) {
done(new Error('ESLint failed.'));