activestorage 7.0.3.1 → 7.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d223d77617c5341863d41685fc68ae30b1a96fe97688851968153d3123ef588d
4
- data.tar.gz: a78b262a1b5713ed6f702a49c87a0055de40165814e3d7d9a8b41ac5965570ea
3
+ metadata.gz: 30d8fadbd6953b6f7df95ba3dd293c0f720d5be32938a81c1395f460f43265d7
4
+ data.tar.gz: 432a78ced992c5717986d2a9bdb08ca21216a73e18246dfd86ce22b3c1c250cc
5
5
  SHA512:
6
- metadata.gz: 15320db3bdd06e5b1218a648ca4961250900ccc924d816c9f4286f85bce354f1845dbedc1ac92f9637ffe1c7089c9920555233055c673315cdd9810f1ea4478e
7
- data.tar.gz: 3c168d10718be7517f9db003da739fcbe7e2f5b943bc45cc7934e40937aae9065e181fcb258b7051f71740e4130f55a7e90d93ff8971328b0c220d741849247b
6
+ metadata.gz: de7317b086cf3d36aaf9a256ebac4cb7ebeb49e5087edbe665c49c17bc28544878d3bb4edc7cff271a4428ca4a57ea7ec66ca454e08aabebed137709c2e0a7ae
7
+ data.tar.gz: 0c8c8623a5c4e071938ae50add7e199274dc874964d1cf64f8ffff1f863f905392e54bb1dca24d0e1cd44f87c099d367080b144da265094bad861c58bb9b709b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## Rails 7.0.4 (September 09, 2022) ##
2
+
3
+ * Fixes proxy downloads of files over 5MiB
4
+
5
+ Previously, trying to view and/or download files larger than 5mb stored in
6
+ services like S3 via proxy mode could return corrupted files at around
7
+ 5.2mb or cause random halts in the download. Now,
8
+ `ActiveStorage::Blobs::ProxyController` correctly handles streaming these
9
+ larger files from the service to the client without any issues.
10
+
11
+ Fixes #44679
12
+
13
+ *Felipe Raul*
14
+
1
15
  ## Rails 7.0.3.1 (July 12, 2022) ##
2
16
 
3
17
  * No changes.
@@ -3,6 +3,7 @@
3
3
  require "securerandom"
4
4
 
5
5
  module ActiveStorage::Streaming
6
+ extend ActiveSupport::Concern
6
7
  DEFAULT_BLOB_STREAMING_DISPOSITION = "inline"
7
8
 
8
9
  include ActionController::DataStreaming
@@ -10,9 +10,14 @@ module ActiveStorage
10
10
 
11
11
  private
12
12
  def read_image
13
- download_blob_to_tempfile do |file|
13
+ begin
14
14
  require "mini_magick"
15
+ rescue LoadError
16
+ logger.info "Skipping image analysis because the mini_magick gem isn't installed"
17
+ return {}
18
+ end
15
19
 
20
+ download_blob_to_tempfile do |file|
16
21
  image = instrument("mini_magick") do
17
22
  MiniMagick::Image.new(file.path)
18
23
  end
@@ -23,13 +28,10 @@ module ActiveStorage
23
28
  logger.info "Skipping image analysis because ImageMagick doesn't support the file"
24
29
  {}
25
30
  end
31
+ rescue MiniMagick::Error => error
32
+ logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
33
+ {}
26
34
  end
27
- rescue LoadError
28
- logger.info "Skipping image analysis because the mini_magick gem isn't installed"
29
- {}
30
- rescue MiniMagick::Error => error
31
- logger.error "Skipping image analysis due to an ImageMagick error: #{error.message}"
32
- {}
33
35
  end
34
36
 
35
37
  def rotated_image?(image)
@@ -10,9 +10,14 @@ module ActiveStorage
10
10
 
11
11
  private
12
12
  def read_image
13
- download_blob_to_tempfile do |file|
13
+ begin
14
14
  require "ruby-vips"
15
+ rescue LoadError
16
+ logger.info "Skipping image analysis because the ruby-vips gem isn't installed"
17
+ return {}
18
+ end
15
19
 
20
+ download_blob_to_tempfile do |file|
16
21
  image = instrument("vips") do
17
22
  ::Vips::Image.new_from_file(file.path, access: :sequential)
18
23
  end
@@ -23,13 +28,10 @@ module ActiveStorage
23
28
  logger.info "Skipping image analysis because Vips doesn't support the file"
24
29
  {}
25
30
  end
31
+ rescue ::Vips::Error => error
32
+ logger.error "Skipping image analysis due to an Vips error: #{error.message}"
33
+ {}
26
34
  end
27
- rescue LoadError
28
- logger.info "Skipping image analysis because the ruby-vips gem isn't installed"
29
- {}
30
- rescue ::Vips::Error => error
31
- logger.error "Skipping image analysis due to an Vips error: #{error.message}"
32
- {}
33
35
  end
34
36
 
35
37
  ROTATIONS = /Right-top|Left-bottom|Top-right|Bottom-left/
@@ -9,8 +9,8 @@ module ActiveStorage
9
9
  module VERSION
10
10
  MAJOR = 7
11
11
  MINOR = 0
12
- TINY = 3
13
- PRE = "1"
12
+ TINY = 4
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.3.1
4
+ version: 7.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 7.0.3.1
19
+ version: 7.0.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 7.0.3.1
26
+ version: 7.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 7.0.3.1
33
+ version: 7.0.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 7.0.3.1
40
+ version: 7.0.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activejob
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 7.0.3.1
47
+ version: 7.0.4
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 7.0.3.1
54
+ version: 7.0.4
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activerecord
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 7.0.3.1
61
+ version: 7.0.4
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 7.0.3.1
68
+ version: 7.0.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: marcel
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -198,10 +198,10 @@ licenses:
198
198
  - MIT
199
199
  metadata:
200
200
  bug_tracker_uri: https://github.com/rails/rails/issues
201
- changelog_uri: https://github.com/rails/rails/blob/v7.0.3.1/activestorage/CHANGELOG.md
202
- documentation_uri: https://api.rubyonrails.org/v7.0.3.1/
201
+ changelog_uri: https://github.com/rails/rails/blob/v7.0.4/activestorage/CHANGELOG.md
202
+ documentation_uri: https://api.rubyonrails.org/v7.0.4/
203
203
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
204
- source_code_uri: https://github.com/rails/rails/tree/v7.0.3.1/activestorage
204
+ source_code_uri: https://github.com/rails/rails/tree/v7.0.4/activestorage
205
205
  rubygems_mfa_required: 'true'
206
206
  post_install_message:
207
207
  rdoc_options: []