Skip to content

Commit a98ce9c

Browse files
Merge pull request #10937 from timvandermeij/node-header-size-limit
Restore the header size limit of 80 KB
2 parents 5517c94 + 95285cb commit a98ce9c

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

gulpfile.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@ function safeSpawnSync(command, parameters, options) {
122122
return result;
123123
}
124124

125+
function startNode(args, options) {
126+
// Node.js decreased the maximum header size from 80 KB to 8 KB in newer
127+
// releases, which is not sufficient for some of our reference test files
128+
// (such as `issue6360.pdf`), so we need to restore this value. Note that
129+
// this argument needs to be before all other arguments as it needs to be
130+
// passed to the Node.js process itself and not to the script that it runs.
131+
args.unshift('--max-http-header-size=80000');
132+
return spawn('node', args, options);
133+
}
134+
125135
function createStringSource(filename, content) {
126136
var source = stream.Readable({ objectMode: true, });
127137
source._read = function () {
@@ -405,7 +415,7 @@ function createTestSource(testsName, bot) {
405415
args.push('--strictVerify');
406416
}
407417

408-
var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
418+
var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', });
409419
testProcess.on('close', function (code) {
410420
source.push(null);
411421
});
@@ -435,7 +445,7 @@ function makeRef(done, bot) {
435445
args.push('--noPrompts', '--strictVerify');
436446
}
437447
args.push('--browserManifestFile=' + PDF_BROWSERS);
438-
var testProcess = spawn('node', args, { cwd: TEST_DIR, stdio: 'inherit', });
448+
var testProcess = startNode(args, { cwd: TEST_DIR, stdio: 'inherit', });
439449
testProcess.on('close', function (code) {
440450
done();
441451
});
@@ -1146,7 +1156,7 @@ gulp.task('baseline', function (done) {
11461156
gulp.task('unittestcli', gulp.series('testing-pre', 'lib', function(done) {
11471157
var options = ['node_modules/jasmine/bin/jasmine',
11481158
'JASMINE_CONFIG_PATH=test/unit/clitests.json'];
1149-
var jasmineProcess = spawn('node', options, { stdio: 'inherit', });
1159+
var jasmineProcess = startNode(options, { stdio: 'inherit', });
11501160
jasmineProcess.on('close', function(code) {
11511161
if (code !== 0) {
11521162
done(new Error('Unit tests failed.'));
@@ -1163,7 +1173,7 @@ gulp.task('lint', gulp.series('default_preferences', function(done) {
11631173
// Ensure that we lint the Firefox specific *.jsm files too.
11641174
var options = ['node_modules/eslint/bin/eslint', '--ext', '.js,.jsm', '.',
11651175
'--report-unused-disable-directives'];
1166-
var esLintProcess = spawn('node', options, { stdio: 'inherit', });
1176+
var esLintProcess = startNode(options, { stdio: 'inherit', });
11671177
esLintProcess.on('close', function (code) {
11681178
if (code !== 0) {
11691179
done(new Error('ESLint failed.'));

0 commit comments

Comments
 (0)