Skip to content

Commit e3c9f85

Browse files
Updated GZIP comparison to work on raw bytes, not a string.
1 parent ec8d9bd commit e3c9f85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/AppleNote.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def get_note_contents
312312
# This function checks if specified +data+ is a GZip object by matching the first two bytes.
313313
def is_gzip(data)
314314
return false if !data.is_a?(String)
315-
return data.start_with?("\x1F\x8B")
315+
return (data.length > 2 and data.bytes[0] == 0x1f and data.bytes[1] == 0x8B)
316316
end
317317

318318
##

0 commit comments

Comments
 (0)