Skip to content

Commit

Permalink
Rack::File -> Rack::Files
Browse files Browse the repository at this point in the history
Only the alias was deprecated: rack/rack#1811
  • Loading branch information
dentarg committed Feb 13, 2023
1 parent 8f57752 commit dace9f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def block.each; yield(call) end
elsif value
# Rack 2.0 returns a Rack::File::Iterator here instead of
# Rack::File as it was in the previous API.
unless request.head? || value.is_a?(Rack::File::Iterator) || value.is_a?(Stream)
unless request.head? || value.is_a?(Rack::Files::Iterator) || value.is_a?(Stream)
headers.delete 'content-length'
end
response.body = value
Expand Down Expand Up @@ -432,7 +432,7 @@ def send_file(path, opts = {})

last_modified opts[:last_modified] if opts[:last_modified]

file = Rack::File.new(File.dirname(settings.app_file))
file = Rack::Files.new(File.dirname(settings.app_file))
result = file.serving(request, path)

result[1].each { |k, v| headers[k] ||= v }
Expand Down

0 comments on commit dace9f5

Please sign in to comment.