From 91d297fdd17c7f6651090b36191b9e6157685a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iva=CC=81n=20A=CC=81lvarez=20Fri=CC=81as?= Date: Sun, 22 Feb 2026 14:33:22 -0600 Subject: [PATCH] fix: add missing url crate dependency browser.rs uses url::Url::parse() but the url crate was not listed in Cargo.toml, causing E0433 and cascading E0282 type inference errors. Note: the axum 0.8 middleware signature fix (State extractor) was already resolved in main. --- Cargo.toml | 3 +++ src/api/server.rs | 14 +++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f5bb2692b..4742591bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,9 @@ redb = "2.4" # Vector / embedding operations fastembed = "4" +# URL parsing +url = "2" + # Encoding base64 = "0.22" diff --git a/src/api/server.rs b/src/api/server.rs index ca4c59972..1c9bfea5d 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -7,8 +7,8 @@ use super::{ }; use axum::Json; -use axum::Router; use axum::extract::{Request, State}; +use axum::Router; use axum::http::{StatusCode, Uri, header}; use axum::middleware::{self, Next}; use axum::response::{Html, IntoResponse, Response}; @@ -177,11 +177,7 @@ pub async fn start_http_server( Ok(handle) } -async fn api_auth_middleware( - State(state): State>, - request: Request, - next: Next, -) -> Response { +async fn api_auth_middleware(State(state): State>, request: Request, next: Next) -> Response { let Some(expected_token) = state.auth_token.as_deref() else { return next.run(request).await; }; @@ -201,11 +197,7 @@ async fn api_auth_middleware( if is_authorized { next.run(request).await } else { - ( - StatusCode::UNAUTHORIZED, - Json(json!({"error": "unauthorized"})), - ) - .into_response() + (StatusCode::UNAUTHORIZED, Json(json!({"error": "unauthorized"}))).into_response() } }