From 77e31ba6eed0e208874d8d09553db963aa55d30e Mon Sep 17 00:00:00 2001 From: LightQuantum Date: Tue, 15 Nov 2022 14:39:20 +0800 Subject: [PATCH] feat: reverse proxy nix-cache-info for better end user experience --- src/repos.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/repos.rs b/src/repos.rs index 1d7d120..c998089 100644 --- a/src/repos.rs +++ b/src/repos.rs @@ -398,17 +398,16 @@ pub fn nix_intel( ); } - if task.path.starts_with("nar/") { + if task.path.starts_with("nar/") || task.path.ends_with(".narinfo") { Ok(task .resolve(&intel_mission, &config) .await? .reverse_proxy(&intel_mission) .await? .into()) - } else if task.path.ends_with(".narinfo") { + } else if task.path == "nix-cache-info" { Ok(task - .resolve(&intel_mission, &config) - .await? + .resolve_upstream() .reverse_proxy(&intel_mission) .await? .into())