Skip to main content

matches_uri

Function matches_uri 

Source
pub fn matches_uri(pattern: &str, uri: &str) -> bool
Expand description

Match a pattern against a resource URI with scheme-awareness.

Rules:

  1. If pattern has a scheme (://), match the full URI as a glob.
  2. If pattern has no scheme (bare path like src/**), auto-prefix with fs://workspace/ and only match fs:// URIs.
  3. Scheme mismatch = no match (safety invariant).
  4. Invalid glob patterns never match (fail-closed).