-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always pass NODE_OPTIONS with max-http-header-size #5452
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
Hm, Mac kitchensink is failing because it only has support for Node 11. Since it's in dev mode, it's launching EDIT: Actually, --max-http-header-size doesn't seem to have any impact when passed to the package app. It only works if supplied in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears like appropriate tests were added and I was able to follow the changes in relation to the PR's functionality. The whitespace changes made it a little hard to discern for a single file, but not impossible. I imagine having those whitespace changes would be ideal given what they were.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran this branch in the services repo - where basically all of their tests were failing with this 431 error - they are now passing. I didn't review the code.
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') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the new max-header log in DEBUG logs for all of our users? Cause I'd like any new options to be logged in their DEBUG logs for future debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not logged anywhere :/ But, it should always be passed, as this is the only condition where it wouldn't be.
* 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
* Detect if NODE_OPTIONS are present in binary; if not, respawn * Always reset NODE_OPTIONS, even if no ORIGINAL_ Co-authored-by: Andrew Smith <andrew@andrew.codes> * Exit with correct code # from stub process * Clean up based on Brian's feedback * how process.versions is null, i have no idea, but it is * add repro for invalid header char * 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 * Revert "Use websockets to stub large XHR response bodies instead of hea… (#5525)" This reverts commit 249db45. * fix yarn.lock * update 4_xhr_spec snapshot * make 6_visit_spec reproduce invalid header char error * pass --http-parser=legacy * still set headers if an ERR_INVALID_CHAR is raised * add --http-parser=legacy in some more places * update http_requests_spec * readd spawn_spec * improve debug logging * remove unnecessary changes * cleanup * revert yarn.lock to develop * use cp.spawn, not cp.fork to work around the Electron patch: https://github.com/electron/electron/blob/39baf6879011c0fe8cc975c7585567c7ed0aeed8/patches/node/refactor_alter_child_process_fork_to_use_execute_script_with.patch Co-authored-by: Andrew Smith <andrew@andrew.codes>
Reverted in #5522
User facing changelog
Fixes a regression in 3.5.0 where the maximum size of an HTTP header or
cy.route()
stub body was limited to 8kb and requests would fail with HTTP error 431.Additional details
--max-http-header-size=${1024 * 1024}
inNODE_OPTIONS
environment var from CLInode
processes launched by Cypress on behalf of the user have desired NODE_OPTIONSHow has the user experience changed?
N/A
PR Tasks