diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2024-07-02 14:13:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-02 14:13:45 +0100 |
| commit | 255a7bccb6c0a7a2cd4ef24a58599aedbfc91aab (patch) | |
| tree | 0e16c5dd498bb5944c1ec71b842840d77166f266 /crates/atuin-server/src/handlers/mod.rs | |
| parent | fix: add idx cache unique index (#2226) (diff) | |
| download | atuin-255a7bccb6c0a7a2cd4ef24a58599aedbfc91aab.zip | |
feat: allow advertising a fake version to clients (#2228)
* feat: allow advertising a fake version to clients
The server usually runs unstable Atuin, and is well monitored. But let's
not advertised the unstable version to clients, as they will notify
users there is an update available.
* fix test build
Diffstat (limited to 'crates/atuin-server/src/handlers/mod.rs')
| -rw-r--r-- | crates/atuin-server/src/handlers/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/atuin-server/src/handlers/mod.rs b/crates/atuin-server/src/handlers/mod.rs index 50f82336..ce10f4b7 100644 --- a/crates/atuin-server/src/handlers/mod.rs +++ b/crates/atuin-server/src/handlers/mod.rs @@ -19,10 +19,16 @@ pub async fn index<DB: Database>(state: State<AppState<DB>>) -> Json<IndexRespon // It's super unlikely this will happen let count = state.database.total_history().await.unwrap_or(-1); + let version = state + .settings + .fake_version + .clone() + .unwrap_or(VERSION.to_string()); + Json(IndexResponse { homage: homage.to_string(), - version: VERSION.to_string(), total_history: count, + version, }) } |
