Skip to content

Verify what value req.headers()?.host carries in the Lambda login function #5

Description

@dickhardt

Transferred from hellocoop/Wallet#1227 (created 2024-11-14): "test what value is in req.headers()?.host in the CDK lamdba login function. Is it the value of the host as exposed publicly or ????"

The code in question is the Lambda adapter in protocol/index.ts. convertToHelloRequest builds the HelloRequest with headers: () => headers, where headers is event.headers from the APIGatewayProxyEventV2. So req.headers()?.host is whatever Host header the Lambda receives: the Function URL / API Gateway domain when invoked directly, or whatever a fronting CloudFront distribution forwards. @hellocoop/api's command handler already prefers x-forwarded-host over host (dist/handlers/command.ts), so the open question is whether the CDK construct's CloudFront/origin config forwards the public host (as host or x-forwarded-host) to the function. Needs a live check with logConfig enabled (the adapter logs the full event) behind a deployed distribution.

Filed here because transfer from the private Wallet repo was blocked (GitHub does not transfer old issues private-to-public).

🤖 Triage by Claude Code - https://claude.ai/code/session_01XqXCHVDWT1BdmyEB9zNCcR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions