don't throw if `ADDRESS_HEADER` is absent in `adapter-node`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
Not all requests will have the header specified. E.g. on render.com when doing a health-check the service does an internal request. This will crash the server because the header is not present.
Describe the proposed solution
Get rid of this code: https://github.com/ivanhofer/kit/blob/export-SubmitFunction/packages/adapter-node/src/handler.js#L94-L100
This would be a breaking change as someone might rely on this error.
An option would also be to make this error throw configurable via an adapter option.
Alternatives considered
Require users to patch the getClientAddress functionality by themself.
As a workaround I currently do this in the first line of the handle function:
event.getClientAddress = () => request.headers.get('cf-connecting-ip')
Importance
would make my life easier
Additional Information
No response
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 in packages/adapter-node/src/handler.js around lines 94-100, where ADDRESS_HEADER handling is described as crashing requests without the header. Trace the handler entry point and existing getClientAddress workaround, then confirm with maintainers whether the intended behavior is removing the throw or making it configurable. Done means requests without the header no longer crash, with corresponding coverage if tests are identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100