Skip to main content

is_worker_asset_path

Function is_worker_asset_path 

Source
pub fn is_worker_asset_path(rel: &Path) -> bool
Expand description

#1883, slice 0: whether rel (output-root-relative) names a file inside some Worker’s assets directory — workers/<dashes>/<WORKER_ASSETS_DIR>/…, at any depth. The ownership rule bynk-driver::output’s reconciliation applies regardless of extension.

Every component after the assets directory must be a plain name (Component::Normal), not just present. Review of #1902: components() keeps .., so checking only that the tail was non-empty accepted workers/x/assets/../../../../etc/x, which the driver’s dir.join would then write outside the output root, where reconciliation can never see it. Slice 1 derives these paths from source, so this is a security rule, not tidiness.