Fix importing of GPX traces with a leading byte order marker

Fixes #2258
This commit is contained in:
Tom Hughes 2019-06-14 18:49:04 +01:00
parent 399ade116a
commit 26cbdcf71a
5 changed files with 16 additions and 5 deletions

View file

@ -51,7 +51,7 @@ module GPX
rescue Archive::Error
io = ::File.open(@file)
case MimeMagic.by_magic(io).type
case MimeMagic.by_magic(io)&.type
when "application/gzip" then io = Zlib::GzipReader.open(@file)
when "application/x-bzip" then io = Bzip2::FFI::Reader.open(@file)
end