Improve Keep-Alive
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 880
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 68
Description
llhttp will in certain edge cases (e.g. HEAD, 204, 304) not allow keep-alive to avoid undetectable parsing failures which can lead to data corruption. These can occur when the target server does not properly implement the HTTP/1.1 specification and this is not entirely uncommon.
However, when the target server is known to be spec compliant, this can lead to performance degradation. A typical case for this is when building a microservice architecture where the different services communicate over HTTP/1.1, and the target server is known.
We recently fixed the case for HEAD requests, but more work can be done here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with llhttp's src/native/http.c at the keep-alive handling referenced in the issue, then review the linked undici pull request for the existing HEAD-request change. Determine the expected behavior for 204 and 304 responses and verify that the completed work preserves protection against parsing failures while allowing keep-alive for compliant targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100