build: echo request id response header

This commit is contained in:
2026-04-21 01:30:16 +08:00
parent f7663076a5
commit 0cbda6aa7c
5 changed files with 30 additions and 2 deletions

View File

@@ -43,7 +43,7 @@
1. 中间件优先读取来访 `x-request-id`,未提供时生成新的 UUID。
2. `request_id` 会统一写入请求 `extensions` 与请求头,供 tracing、错误处理中间件和响应头层复用。
3. 响应回写 `x-request-id` 仍属于后续独立任务,本阶段只完成请求上下文准备
3. 最终响应回写同一个 `x-request-id`,保证调用方、日志链路和后续 envelope `meta.requestId` 可对齐
当前错误处理中间件约定: