Switch GPX MIME type detection to use marcel

This commit is contained in:
Tom Hughes 2021-03-30 18:26:23 +01:00
parent 7bdd4e6809
commit 4a6b1e54a5
3 changed files with 3 additions and 6 deletions

View file

@ -109,7 +109,7 @@ gem "logstasher"
gem "bzip2-ffi"
gem "ffi-libarchive"
gem "gd2-ffij", ">= 0.4.0"
gem "mimemagic"
gem "marcel"
# Used for browser detection
gem "browser"

View file

@ -259,9 +259,6 @@ GEM
marcel (1.0.0)
maxminddb (0.1.22)
method_source (1.0.0)
mimemagic (0.4.3)
nokogiri (~> 1)
rake
mini_magick (4.11.0)
mini_mime (1.0.3)
mini_portile2 (2.5.0)
@ -512,8 +509,8 @@ DEPENDENCIES
libxml-ruby (>= 2.0.5)
listen
logstasher
marcel
maxminddb
mimemagic
mini_magick
minitest (~> 5.1)
oauth-plugin (>= 0.5.1)

View file

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