FIX: Add another method to check binary file (#15648)
This method looks for a NULL byte that is not usually contained in text
files. Follow up to 376799b1a4
.
This commit is contained in:
parent
a582c49601
commit
847c77de65
|
@ -169,7 +169,7 @@ module Onebox
|
|||
else
|
||||
contents = URI.parse(self.raw_template(m)).open(read_timeout: timeout).read
|
||||
|
||||
if contents.encoding == Encoding::BINARY
|
||||
if contents.encoding == Encoding::BINARY || contents.bytes.include?(0)
|
||||
@raw = nil
|
||||
@binary = true
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue