Skip to content

Commit 09c7ebc

Browse files
committed
Rely on the digest class defined by Rails
Rails applications can override the digest class through configuration settings. Further, Rails does this by default in versions suchs as 7 where it defaults to SHA256. Using ActiveSupport::Digest directly skips over this setting causing it to always be MD5 in the current state. This breaks in modern environments MD5 is disabled such as FIPS environments. Signed-off-by: Eric D. Helms <ericdhelms@gmail.com>
1 parent a654f73 commit 09c7ebc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/angular-rails-templates/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class Engine < ::Rails::Engine
3737

3838
# Sprockets Cache Busting
3939
# If ART's version or settings change, expire and recompile all assets
40-
hash_digest = defined?(ActiveSupport::Digest) ? ActiveSupport::Digest : Digest::MD5
40+
hash_digest = app.config.active_support.hash_digest_class || ActiveSupport::Digest.hash_digest_class
4141
app.config.assets.version = [
4242
app.config.assets.version,
4343
'ART',

0 commit comments

Comments
 (0)