Skip to content

Commit f07a4f8

Browse files
committed
Strip encrypt file contents
If a newline accidentally gets added to the encrypted content file, it is unable to be decrypted. Like the key file, this ensures that the content is stripped of newlines before decryption.
1 parent 92e9b23 commit f07a4f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/lib/active_support/encrypted_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def key?
6969
# decrypted or verified.
7070
def read
7171
if !key.nil? && content_path.exist?
72-
decrypt content_path.binread
72+
decrypt content_path.binread.strip
7373
else
7474
raise MissingContentError, content_path
7575
end

0 commit comments

Comments
 (0)