Run LegacyUrlMatcher through ChainMatcher. That necessitates making ChainMatcher temporarily context-aware.