Skip to content

Commit

Permalink
use --max-http-header-size, change max size from 8kb to 1mb, fix #76
Browse files Browse the repository at this point in the history
  • Loading branch information
flotwig committed Jul 29, 2019
1 parent 036b444 commit ae5def7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/lib/exec/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ module.exports = {
)
}

// max HTTP header size 8kb -> 1mb
// https://github.com/cypress-io/cypress/pull/4720#issuecomment-514316695
args.unshift(`--max-http-header-size=${1024 * 1024}`)

const { onStderrData, electronLogging } = overrides
const envOverrides = util.getEnvOverrides()
const electronArgs = _.clone(args)
Expand Down
2 changes: 2 additions & 0 deletions cli/test/lib/exec/spawn_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ describe('lib/exec/spawn', function () {
return spawn.start('--foo', { foo: 'bar' })
.then(() => {
expect(cp.spawn).to.be.calledWithMatch('/path/to/cypress', [
'--max-http-header-size=1048576',
'--foo',
'--cwd',
cwd,
Expand All @@ -97,6 +98,7 @@ describe('lib/exec/spawn', function () {
return spawn.start('--foo', { dev: true, foo: 'bar' })
.then(() => {
expect(cp.spawn).to.be.calledWithMatch('node', [
'--max-http-header-size=1048576',
p,
'--foo',
'--cwd',
Expand Down
4 changes: 4 additions & 0 deletions packages/electron/lib/electron.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ module.exports = {
if opts.inspectBrk
argv.unshift("--inspect-brk=5566")

## max HTTP header size 8kb -> 1mb
## https://github.com/cypress-io/cypress/pull/4720#issuecomment-514316695
argv.unshift("--max-http-header-size=#{1024*1024}")

debug("spawning %s with args", execPath, argv)

if debug.enabled
Expand Down
3 changes: 3 additions & 0 deletions packages/server/test/scripts/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ if (options['inspect-brk']) {
}

commandAndArguments.args.push(
// max HTTP header size 8kb -> 1mb
// https://github.com/cypress-io/cypress/pull/4720#issuecomment-514316695
`--max-http-header-size=${1024 * 1024}`,
'node_modules/.bin/_mocha',
run
)
Expand Down

0 comments on commit ae5def7

Please sign in to comment.