summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx/util/mime_type_utils.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/axlsx/util/mime_type_utils.rb b/lib/axlsx/util/mime_type_utils.rb
index 5a6ad38e..f0c3afb1 100644
--- a/lib/axlsx/util/mime_type_utils.rb
+++ b/lib/axlsx/util/mime_type_utils.rb
@@ -14,7 +14,11 @@ module Axlsx
# @param [String] v URI
# @return [String] File mime type
def self.get_mime_type_from_uri(v)
- Marcel::MimeType.for(URI.open(v))
+ if URI.respond_to?(:open)
+ Marcel::MimeType.for(URI.open(v))
+ else
+ Marcel::MimeType.for(URI.parse(v).open)
+ end
end
end
end