From d3cdfdb7a56adf202821a7b4c54566e0705b290e Mon Sep 17 00:00:00 2001 From: hugocasa Date: Mon, 31 Aug 2026 09:28:05 +0200 Subject: [PATCH] fix: let an unavailable cors read defer to one that resolved --- backend/windmill-api/src/triggers/http/handler.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/backend/windmill-api/src/triggers/http/handler.rs b/backend/windmill-api/src/triggers/http/handler.rs index c87847c96c..10ac68c588 100644 --- a/backend/windmill-api/src/triggers/http/handler.rs +++ b/backend/windmill-api/src/triggers/http/handler.rs @@ -115,7 +115,14 @@ impl CorsDecision { fn stricter(self, other: Self) -> Self { use CorsDecision::*; match (self, other) { - (Unavailable, _) | (_, Unavailable) => Unavailable, + // A read that could not see the routers knows nothing, so it defers + // to one that could: a transient load failure on either side must + // not discard a real verdict. Only when neither read saw them is + // the answer genuinely unknown — and then the handler could not + // resolve the trigger either, so the response is an error rather + // than a runnable's output. + (Unavailable, Unavailable) => Unavailable, + (Unavailable, known) | (known, Unavailable) => known, ( Restricted { route_method, allow_origin }, Restricted { allow_origin: also_allowed, .. },