From 2fbc0e87ce4876371beaaae4474994fd31f6ef2c Mon Sep 17 00:00:00 2001 From: argszero Date: Wed, 30 Sep 2026 03:30:22 +0800 Subject: [PATCH] docs(routes): point the /healthz header at CARGO_PKG_VERSION, not a literal The module header documented the /healthz response as `{"status":"ok","version":"0.2.0"}` while the handler in the same file returns `env!("CARGO_PKG_VERSION")` -- 0.2.0 was the version the day the line was written (91aaba09, 2026-08-18) and it has been stale for the 26 releases since. The repo states the "never hardcode the version" rule in three other carriers (routes/ops.rs, ui/js/app.js, ui/README.md), all of which point at CARGO_PKG_VERSION as the one source shared with /healthz. Replace the snapshot with a pointer to that mechanism so it cannot drift again. Note-style only; no production logic changes. --- src/routes/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/mod.rs b/src/routes/mod.rs index 456e9f4..136b9d3 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -1,7 +1,7 @@ //! HTTP 路由装配:healthz + 认证 + API Key 管理 + 网关/市场端点 //! //! P0-A(rant 2026-08-17T22:21:52): -//! - GET /healthz → {"status":"ok","version":"0.2.0"} +//! - GET /healthz → {"status":"ok","version":""}(取自 env!("CARGO_PKG_VERSION"),不得写死) //! - POST /api/auth/login → 200 {api_key} / 401 //! - POST /api/api-keys / GET /api/api-keys(Bearer 认证) //!