From 9d1902be19d305961505fa938f7acb8bbacf673e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 5 Jun 2020 12:38:32 -0400 Subject: [PATCH] Only digest the environment version if it is not blank --- lib/sprockets/asset.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/sprockets/asset.rb b/lib/sprockets/asset.rb index bb204b854..28267a227 100644 --- a/lib/sprockets/asset.rb +++ b/lib/sprockets/asset.rb @@ -135,7 +135,13 @@ def hexdigest # Pubic: ETag String of Asset. def etag - DigestUtils.hexdigest(environment_version.to_s + digest) + version = environment_version + + if version && version != "" + DigestUtils.hexdigest(version + digest) + else + DigestUtils.pack_hexdigest(digest) + end end # Public: Returns String base64 digest of source.