You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generate a request ID when X-Request-ID is not supplied #70
The API Gateway v2 adapter currently derives requestContext.requestId from the incoming X-Request-ID header.
If no upstream component supplies the header, the resulting request ID is empty. Additionally, when Caddy is directly Internet-facing, the value may be entirely client-controlled.
caddy-lambda should ensure that every invocation has a useful correlation ID.
Proposed behaviour
When handling a request:
Use an existing X-Request-ID where appropriate.
If none exists, generate a request ID.
Use the resulting value for:
requestContext.requestId
caddy-lambda structured logs
invocation logging
Consider returning the ID to the client as X-Request-ID.
A UUID or similarly collision-resistant identifier would be sufficient.
We should decide separately whether incoming client-supplied IDs should always be trusted or whether caddy-lambda should distinguish between an external request ID and its own internal correlation ID.
Acceptance criteria
Every Lambda invocation has a non-empty request ID.
The same ID is available in the Lambda event and caddy-lambda logs.
Requests without X-Request-ID receive a generated ID.
Behaviour for an existing X-Request-ID is documented and tested.
Adding the security label. /oc please create a PR for this one. The request ID should be as close to the real API GW ID as possible, in case the lambda app is validating the value.
Activity
danmoz commentedon Sep 5, 2026
Adding the security label. /oc please create a PR for this one. The request ID should be as close to the real API GW ID as possible, in case the lambda app is validating the value.
opencode-agent commentedon Sep 5, 2026
Created PR #72
opencode session | github run