Skip to content

Commit

Permalink
Updated GZIP comparison to work on raw bytes, not a string.
Browse files Browse the repository at this point in the history
  • Loading branch information
threeplanetssoftware committed Dec 17, 2024
1 parent ec8d9bd commit e3c9f85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/AppleNote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def get_note_contents
# This function checks if specified +data+ is a GZip object by matching the first two bytes.
def is_gzip(data)
return false if !data.is_a?(String)
return data.start_with?("\x1F\x8B")
return (data.length > 2 and data.bytes[0] == 0x1f and data.bytes[1] == 0x8B)
end

##
Expand Down

0 comments on commit e3c9f85

Please sign in to comment.