carrierwave 3.1.2 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fce89671ca96c66db403199f1eab005bdb208ae699bcd6c6d58d470ec337d96
|
|
4
|
+
data.tar.gz: 0047624b2e05641fbb2d65d97815726e9bc296fc8cdb53c37815ead2ce30d6e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5f63f1e37da1f107660263cc2d4be4e09dd0076e12bf80bc057449ddbd288887210ae17392d4092ff240c9992be3819721e7665a72023e4b58a8e9d351434d37
|
|
7
|
+
data.tar.gz: 205220c3605f50f23379781d94c587aee68a75aa7d4d854a258d362983122115641482098e81574dd873acce90deeb124d01b24c9ff7970dc45c2cb3146a9bd1
|
|
@@ -317,10 +317,18 @@ module CarrierWave
|
|
|
317
317
|
def declared_content_type
|
|
318
318
|
@declared_content_type ||
|
|
319
319
|
if @file.respond_to?(:content_type) && @file.content_type
|
|
320
|
-
Marcel::MimeType.for(declared_type: @file.content_type
|
|
320
|
+
Marcel::MimeType.for(declared_type: first_declared_content_type(@file.content_type))
|
|
321
321
|
end
|
|
322
322
|
end
|
|
323
323
|
|
|
324
|
+
# Clients occasionally send more than one MIME type in a single header
|
|
325
|
+
# (e.g. "image/png; text/html" or "image/png, text/html"). Marcel 2 validates
|
|
326
|
+
# the declared type against the RFC grammar and rejects such values, so pick
|
|
327
|
+
# the first media type ourselves before handing it over.
|
|
328
|
+
def first_declared_content_type(content_type)
|
|
329
|
+
content_type.to_s.strip.split(/[;,\s]/, 2).first
|
|
330
|
+
end
|
|
331
|
+
|
|
324
332
|
# Guess content type from its file extension. Limit what to be returned to prevent spoofing.
|
|
325
333
|
def guessed_safe_content_type
|
|
326
334
|
return unless path
|
|
@@ -54,7 +54,10 @@ module CarrierWave
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def denylisted_content_type?(denylist, content_type)
|
|
57
|
-
Array(denylist).any?
|
|
57
|
+
Array(denylist).any? do |item|
|
|
58
|
+
item = Regexp.quote(item) if item.class != Regexp
|
|
59
|
+
content_type =~ /#{item}/
|
|
60
|
+
end
|
|
58
61
|
end
|
|
59
62
|
|
|
60
63
|
end # ContentTypeDenylist
|
data/lib/carrierwave/version.rb
CHANGED
|
@@ -40,6 +40,14 @@ class <%= class_name %>Uploader < CarrierWave::Uploader::Base
|
|
|
40
40
|
# %w(jpg jpeg gif png)
|
|
41
41
|
# end
|
|
42
42
|
|
|
43
|
+
# Add a content_type_allowlist to restrict uploads by MIME type.
|
|
44
|
+
# Without it, a user could upload a harmful file
|
|
45
|
+
# with a safe extension (content-type spoofing).
|
|
46
|
+
# For the previous extension_allowlist you might use something like this:
|
|
47
|
+
# def content_type_allowlist
|
|
48
|
+
# /image\//
|
|
49
|
+
# end
|
|
50
|
+
|
|
43
51
|
# Override the filename of the uploaded files:
|
|
44
52
|
# Avoid using model.id or version_name here, see uploader/store.rb for details.
|
|
45
53
|
# def filename
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: carrierwave
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.1.
|
|
4
|
+
version: 3.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonas Nicklas
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -42,30 +41,42 @@ dependencies:
|
|
|
42
41
|
name: image_processing
|
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
|
44
43
|
requirements:
|
|
45
|
-
- - "
|
|
44
|
+
- - ">="
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
46
|
version: '1.1'
|
|
47
|
+
- - "<"
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: '3'
|
|
48
50
|
type: :runtime
|
|
49
51
|
prerelease: false
|
|
50
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
53
|
requirements:
|
|
52
|
-
- - "
|
|
54
|
+
- - ">="
|
|
53
55
|
- !ruby/object:Gem::Version
|
|
54
56
|
version: '1.1'
|
|
57
|
+
- - "<"
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: '3'
|
|
55
60
|
- !ruby/object:Gem::Dependency
|
|
56
61
|
name: marcel
|
|
57
62
|
requirement: !ruby/object:Gem::Requirement
|
|
58
63
|
requirements:
|
|
59
|
-
- - "
|
|
64
|
+
- - ">="
|
|
60
65
|
- !ruby/object:Gem::Version
|
|
61
66
|
version: 1.0.0
|
|
67
|
+
- - "<"
|
|
68
|
+
- !ruby/object:Gem::Version
|
|
69
|
+
version: '3'
|
|
62
70
|
type: :runtime
|
|
63
71
|
prerelease: false
|
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
65
73
|
requirements:
|
|
66
|
-
- - "
|
|
74
|
+
- - ">="
|
|
67
75
|
- !ruby/object:Gem::Version
|
|
68
76
|
version: 1.0.0
|
|
77
|
+
- - "<"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '3'
|
|
69
80
|
- !ruby/object:Gem::Dependency
|
|
70
81
|
name: addressable
|
|
71
82
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -240,6 +251,20 @@ dependencies:
|
|
|
240
251
|
- - ">="
|
|
241
252
|
- !ruby/object:Gem::Version
|
|
242
253
|
version: '0'
|
|
254
|
+
- !ruby/object:Gem::Dependency
|
|
255
|
+
name: ruby-vips
|
|
256
|
+
requirement: !ruby/object:Gem::Requirement
|
|
257
|
+
requirements:
|
|
258
|
+
- - ">="
|
|
259
|
+
- !ruby/object:Gem::Version
|
|
260
|
+
version: '0'
|
|
261
|
+
type: :development
|
|
262
|
+
prerelease: false
|
|
263
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
264
|
+
requirements:
|
|
265
|
+
- - ">="
|
|
266
|
+
- !ruby/object:Gem::Version
|
|
267
|
+
version: '0'
|
|
243
268
|
- !ruby/object:Gem::Dependency
|
|
244
269
|
name: rmagick
|
|
245
270
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -369,8 +394,8 @@ files:
|
|
|
369
394
|
homepage: https://github.com/carrierwaveuploader/carrierwave
|
|
370
395
|
licenses:
|
|
371
396
|
- MIT
|
|
372
|
-
metadata:
|
|
373
|
-
|
|
397
|
+
metadata:
|
|
398
|
+
changelog_uri: https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md
|
|
374
399
|
rdoc_options:
|
|
375
400
|
- "--main"
|
|
376
401
|
require_paths:
|
|
@@ -386,8 +411,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
386
411
|
- !ruby/object:Gem::Version
|
|
387
412
|
version: '0'
|
|
388
413
|
requirements: []
|
|
389
|
-
rubygems_version:
|
|
390
|
-
signing_key:
|
|
414
|
+
rubygems_version: 4.0.19
|
|
391
415
|
specification_version: 4
|
|
392
416
|
summary: Ruby file upload library
|
|
393
417
|
test_files: []
|