Module: ReactOnRailsPro::RollingDeploy
- Defined in:
- lib/react_on_rails_pro/rolling_deploy/tarball.rb,
lib/react_on_rails_pro/rolling_deploy/safe_hash_pattern.rb,
app/controllers/react_on_rails_pro/rolling_deploy/bundles_controller.rb
Defined Under Namespace
Modules: Tarball Classes: BundlesController
Constant Summary collapse
- SAFE_HASH_PATTERN =
Path-safety regex shared by the rolling-deploy cache stager, the bundles controller route constraint, and the HTTP adapter. Rejects empty strings, leading dots, leading hyphens, path separators, ‘..`, and anything outside a flat alphanumeric basename plus `_`, `.`, and `-`. The first character must be alphanumeric or `_` — leading hyphens are a common shell footgun and webpack content hashes never start with one in practice.
/\A[A-Za-z0-9_][A-Za-z0-9_.\-]*\z/