filestack 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/filestack/ruby/version.rb +1 -1
- data/lib/filestack/utils/multipart_upload_utils.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db535c63bd1fd4b140f7450c908995306012150335eb9ee6974c462b1752b70f
|
4
|
+
data.tar.gz: 9abd562d8604200f27b50d94300c67e5beab7e42f2b05613ed655fa31ea5a210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2deddcc79603eb57cc84ef8037eb025e8dbee71f2b1a4616062708e0e1d525827bebad21d50c6b2fa90f8a1cd78f58a6af24e80aa6b068bb8d566e3b9849dad7
|
7
|
+
data.tar.gz: ac4740114ff55eb5a616fa9f9793b04605d2e41ff05158033de5dd0eb02b839b7964a4031c5fede4fd537bdeec25ab16d25f86a64bebe977cc76fefeab79c695
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.9.
|
1
|
+
2.9.3
|
@@ -16,7 +16,7 @@ module MultipartUploadUtils
|
|
16
16
|
|
17
17
|
def get_file_attributes(file, options = {})
|
18
18
|
filename = options[:filename] || File.basename(file)
|
19
|
-
mimetype = options[:mimetype] ||
|
19
|
+
mimetype = options[:mimetype] || get_mimetype_from_file(file) || FilestackConfig::DEFAULT_UPLOAD_MIMETYPE
|
20
20
|
filesize = File.size(file)
|
21
21
|
|
22
22
|
[filename, filesize, mimetype.to_s]
|
@@ -280,4 +280,12 @@ module MultipartUploadUtils
|
|
280
280
|
end
|
281
281
|
JSON.parse(response_complete.body)
|
282
282
|
end
|
283
|
+
|
284
|
+
private
|
285
|
+
|
286
|
+
def get_mimetype_from_file(file)
|
287
|
+
file_info = MiniMime.lookup_by_filename(File.open(file))
|
288
|
+
|
289
|
+
file_info ? file_info.content_type : nil
|
290
|
+
end
|
283
291
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filestack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Filestack
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|