Skip to content

Commit bd03894

Browse files
Moved httpjson request ID notes to HTTPJSON section
Co-authored-by: danmoz <danmoz@users.noreply.github.com>
1 parent ebcffc6 commit bd03894

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ The Lambda function should return a JSON object with a `type` of
166166
`body`. Response metadata can set the HTTP status and headers; `bodyEncoding`
167167
can be set to `base64` for binary response bodies.
168168

169+
For `httpjson`, an incoming `X-Request-ID` header is preserved in
170+
`meta.headers`; when it is absent, no synthetic ID is generated. When an ID is
171+
present, it is used in structured logs and returned to the client in the
172+
`X-Request-ID` response header.
173+
169174
### API Gateway v2
170175

171176
For API Gateway v2 events, request headers and duplicate query parameters use
@@ -187,10 +192,9 @@ handler errors.
187192

188193
For `api_gateway_v2`, an incoming `X-Request-ID` header is preserved; when it
189194
is absent, caddy-lambda generates a UUID matching the format used by AWS API
190-
Gateway and places it in `requestContext.requestId`. For `httpjson`, an
191-
incoming ID is preserved in `meta.headers`, but no synthetic ID is generated
192-
when it is absent. When an ID is present, it is used in structured logs and
193-
returned to the client in the `X-Request-ID` response header.
195+
Gateway and places it in `requestContext.requestId`. When an ID is present, it
196+
is used in structured logs and returned to the client in the `X-Request-ID`
197+
response header.
194198

195199
## Logging
196200

0 commit comments

Comments
 (0)