mini_defender 0.6.3 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_defender/rules/mime_types.rb +5 -3
- data/lib/mini_defender/version.rb +1 -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: 12e38770ec94ea06cf7c9a6f40af0cc37fc2017deb30161c2804c9e3024d7ad4
|
4
|
+
data.tar.gz: 36738ff2ca0ad2316dbb0f68fee90ad921690fab463cf4050103789edb975212
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94d2291d0f17296b246ae67f96685f20dd7c7316d7ed329d89fc2141d76af57c538ca3909b52be177b9d08663448c2941669668861ba0408d40bdb10f75ad462
|
7
|
+
data.tar.gz: d5f5aab2a675b44ce991573938eea9ca9782e954971365d71102ba6e8081b802d76cffa4f3382354bbf04695028e88cede5686146c28003ef1c1ee4f8f33e30a
|
@@ -17,14 +17,16 @@ class MiniDefender::Rules::MimeTypes < MiniDefender::Rule
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.make(args)
|
20
|
-
|
20
|
+
unless args.length > 0
|
21
|
+
raise ArgumentError, 'Expected at least one MIME type.'
|
22
|
+
end
|
21
23
|
|
22
|
-
new(args.
|
24
|
+
new(args.map(&:downcase).map(&:strip))
|
23
25
|
end
|
24
26
|
|
25
27
|
def passes?(attribute, value, validator)
|
26
28
|
@file = value.is_a?(ActionDispatch::Http::UploadedFile)
|
27
|
-
@file && @types.include?(
|
29
|
+
@file && @types.include?(value.content_type)
|
28
30
|
end
|
29
31
|
|
30
32
|
def message(attribute, value, validator)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_defender
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Alhoshaiyan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|