fix(dispatch): enforce match criteria for fallback routes

This commit is contained in:
RhenCloud 2026-08-03 08:35:47 +08:00
parent 80cc85cd76
commit ac8b4a77b8
No known key found for this signature in database
GPG key ID: A574A617378C4E0B

View file

@ -33,7 +33,7 @@ export async function dispatchEvent(config: Config, event: WebhookEvent, env: En
const tasks = config.routes const tasks = config.routes
.filter((route) => { .filter((route) => {
if (!accepted(route)) return false; if (!accepted(route)) return false;
if (route.fallback) return !anyRegularMatched; if (route.fallback) return !anyRegularMatched && matchRoute(route, event);
return matchRoute(route, event); return matchRoute(route, event);
}) })
.map(async (route) => { .map(async (route) => {