oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.23k stars 2.77k forks source link

Allow `MAX_HEADERS` to be configurable. #6982

Open TomHennessy opened 1 year ago

TomHennessy commented 1 year ago

What is the problem this feature would solve?

Currently a system my team and I would like to migrate over is blocked by headers not being passed through. This is because there's a hard limit of 50 set here: https://github.com/oven-sh/bun/blob/131b96bbba3c2fc02b418e36a1ec0f9f7801171d/packages/bun-uws/src/HttpParser.h#L49C1-L49C1

Allowing this value to be configurable would allow us to increase it as we've audited the headers we're sending and we could get down only to around 70.

What is the feature you are proposing to solve the problem?

An optional config option that gives control over this constant.

What alternatives have you considered?

Electroid commented 1 year ago

We should probably increase the default value, and adding some way to configure this makes sense.

TomHennessy commented 1 year ago

We should probably increase the default value, and adding some way to configure this makes sense.

That'd be great! Would you like me to create a PR for it? If so, what value sounds reasonable to increase it to?

I'll leave the configurability to you unless you're clear on how you'd like it done and could point me in that direction.

morpig commented 11 months ago

@TomHennessy i wonder what response/return data was sent from bun when max_headers are reached?

trying to debug a similar issue, in my case it was "connection terminated"