Skip to content

Commit

Permalink
Only digest the environment version if it is not blank
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfranca committed Jun 5, 2020
1 parent 97e2ac6 commit 9d1902b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/sprockets/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9d1902b

Please sign in to comment.