Skip to content

fix: increase max HTTP header size to 32kb bytes across all environments#719

Merged
aborovsky merged 10 commits intonextfrom
fix/increase-max-http-header-size
Feb 2, 2026
Merged

fix: increase max HTTP header size to 32kb bytes across all environments#719
aborovsky merged 10 commits intonextfrom
fix/increase-max-http-header-size

Conversation

@aborovsky
Copy link
Contributor

At the moment, bright-cli fails when the target responds with an HTTP header block larger than 16 KB, which is the default limit enforced by Node.js.

The Bright repeater infrastructure is already capable of handling HTTP response headers up to 32 KB, which creates a mismatch between the repeater and bright-cli behavior. To keep both components aligned and allow bright-cli to process responses normally, the maximum supported HTTP header size should be increased to 32 KB.

If response headers exceed this increased limit, bright-cli will continue to throw HPE_HEADER_OVERFLOW, which matches the current and expected behavior.

@aborovsky aborovsky requested a review from Copilot January 29, 2026 15:24
@aborovsky aborovsky self-assigned this Jan 29, 2026
@aborovsky aborovsky added the Type: bug Something isn't working. label Jan 29, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR increases the maximum HTTP header size supported by bright-cli from the default 16 KB to 32 KB to align with the Bright repeater infrastructure. This prevents HPE_HEADER_OVERFLOW errors when the target responds with HTTP headers between 16-32 KB.

Changes:

  • Added NODE_OPTIONS environment variable configuration across all execution environments
  • Updated test scripts to support larger HTTP headers during testing
  • Modified build configuration to embed the setting in packaged executables

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
package.json Updated npm scripts (test:e2e, test:smoke, start) to set NODE_OPTIONS=--max-http-header-size=32768 and modified build:pkg to pass the same option to pkg
Dockerfile Added NODE_OPTIONS environment variable to set max-http-header-size=32768 for containerized deployments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aborovsky
Copy link
Contributor Author

While there is no e2e test for this case, I've tested locally:

npm run build
npm run build:pkg -- -t node22-macos-x64
./bin/cli repeater --log-level 4 --hostname localhost repeater --id ******* --token *****

2026-01-29T15:38:51.680Z [VERBOSE] Executing HTTP request with following params: {"protocol":"http","url":"http://localhost:4444/post-with-huge-headers","body":"","method":"POST","headers":{"host":"localhost:4444","user-agent":"curl/8.7.1","accept":"*/*","x-huge-header":"1384529617f340c...24kb...of...data...here... 2451ca0d77079b7dd6f5"}}

@aborovsky aborovsky marked this pull request as ready for review January 29, 2026 15:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

alonchin
alonchin previously approved these changes Feb 1, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aborovsky aborovsky requested a review from lsndr February 1, 2026 22:47
@aborovsky aborovsky requested a review from lsndr February 2, 2026 13:20
@aborovsky aborovsky merged commit c03594e into next Feb 2, 2026
6 checks passed
@aborovsky aborovsky deleted the fix/increase-max-http-header-size branch February 2, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: bug Something isn't working.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants