mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-08 15:59:46 -05:00
Always pass NODE_OPTIONS with max-http-header-size (#5452)
* cli: set NODE_OPTIONS=--max-http-header-size=1024*1024 on spawn * electron: remove redundant max-http-header-size * server: add useCli option to make e2e tests go thru cli * server: add test for XHR with body > 100kb via CLI * clean up conditional * cli: don't pass --max-http-header-size in dev w node < 11.10 * add original_node_options to restore o.g. user node_options * force no color
This commit is contained in:
committed by
Jennifer Shehane
parent
3a747abf5d
commit
978d97ee6d
@@ -102,7 +102,7 @@ module.exports = {
|
||||
}
|
||||
|
||||
const { onStderrData, electronLogging } = overrides
|
||||
const envOverrides = util.getEnvOverrides()
|
||||
const envOverrides = util.getEnvOverrides(options)
|
||||
const electronArgs = _.clone(args)
|
||||
const node11WindowsFix = isPlatform('win32')
|
||||
|
||||
|
||||
+27
-1
@@ -184,7 +184,7 @@ const util = {
|
||||
return isCi
|
||||
},
|
||||
|
||||
getEnvOverrides () {
|
||||
getEnvOverrides (options = {}) {
|
||||
return _
|
||||
.chain({})
|
||||
.extend(util.getEnvColors())
|
||||
@@ -193,9 +193,35 @@ const util = {
|
||||
.mapValues((value) => { // stringify to 1 or 0
|
||||
return value ? '1' : '0'
|
||||
})
|
||||
.extend(util.getNodeOptions(options))
|
||||
.value()
|
||||
},
|
||||
|
||||
getNodeOptions (options, nodeVersion) {
|
||||
if (!nodeVersion) {
|
||||
nodeVersion = Number(process.versions.node.split('.')[0])
|
||||
}
|
||||
|
||||
if (options.dev && nodeVersion < 12) {
|
||||
// `node` is used when --dev is passed, so this won't work if Node is too old
|
||||
logger.warn('(dev-mode warning only) NODE_OPTIONS=--max-http-header-size could not be set. See https://github.com/cypress-io/cypress/pull/5452')
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// https://github.com/cypress-io/cypress/issues/5431
|
||||
const NODE_OPTIONS = `--max-http-header-size=${1024 * 1024}`
|
||||
|
||||
if (_.isString(process.env.NODE_OPTIONS)) {
|
||||
return {
|
||||
NODE_OPTIONS: `${NODE_OPTIONS} ${process.env.NODE_OPTIONS}`,
|
||||
ORIGINAL_NODE_OPTIONS: process.env.NODE_OPTIONS || '',
|
||||
}
|
||||
}
|
||||
|
||||
return { NODE_OPTIONS }
|
||||
},
|
||||
|
||||
getForceTty () {
|
||||
return {
|
||||
FORCE_STDIN_TTY: util.isTty(process.stdin.fd),
|
||||
|
||||
Reference in New Issue
Block a user