Skip to content

Commit 22beccb

Browse files
salzigJoschkaSchulz
authored andcommitted
fix: Kernel#open for URL got deprecated with 2.7
1 parent eeadc1c commit 22beccb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controllers/images_controller.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# frozen_string_literal: true
22

3+
require 'uri'
4+
35
class ImagesController < ActionController::Base
46
PUBLIC_MOUNTS = {
57
'User' => :image,
@@ -17,7 +19,7 @@ def show
1719
url = model.send(attribute_name)
1820

1921
if url.present?
20-
open(url) do |f|
22+
URI.open(url) do |f|
2123
send_data(f.read, filename:, disposition: :inline, content_type: f.content_type)
2224
end
2325
else

0 commit comments

Comments
 (0)