Outerfaces.Odd.Plugs.OddRevProxyPlug (Outerfaces Dependency Distribution (ODD) v0.2.8)
View SourcePlug for parsing and validating rev-pinned URLs.
This plug:
- Detects requests to
/__rev/<rev>/<namespace>/<path>URLs - Validates that
<rev>matches the current rev - Strips the
/__rev/<rev>prefix from the path - Sets conn assigns for downstream plugs
- Handles rev mismatches (redirect navigations, 409 for assets)
Configuration
plug OddRevProxyPlug, mismatch_behavior: :redirect # or :conflict:rev_scope checks rev-pinned URLs against that scope's rev
(Outerfaces.Rev.current_rev/1) instead of the global one, and assigns
outerfaces_rev on every request, rev-pinned or not, so the rofl HTML, CSS
and JS plugs downstream pin to the scope's rev too:
plug OddRevProxyPlug, mismatch_behavior: :redirect, rev_scope: :docs_siteConn Assigns
outerfaces_rev- The rev value extracted from the URL (if present)outerfaces_rev_namespace- The namespace (spa, cdn, apps, etc.)outerfaces_rev_matched- Boolean indicating if the rev matches current_rev()outerfaces_rev_current- The current rev value (set on mismatch)