Skip to content

don't throw if ADDRESS_HEADER is absent in adapter-node #9359

@ivanhofer

Description

@ivanhofer

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions