Skip to main content

classify_and_route

Function classify_and_route 

Source
pub fn classify_and_route(signature: &PageSignature) -> RouterDecision
Expand description

One-shot helper: classify + route via a default router. Convenience for tests and call sites that don’t need to customise the policy.

§Example

use stygian_browser::interstitial_router::{
    classify_and_route, InterstitialKind, PageSignature,
};

let sig = PageSignature::new("https://example.com/cdn-cgi/challenge-platform/h/b", Some(403))
    .with_body_marker("cf-chl-bypass");
let decision = classify_and_route(&sig);
assert_eq!(decision.kind(), InterstitialKind::Challenge);