`Rack::File` -> `Rack::Files` (#1877)
The alias was deprecated: https://github.com/rack/rack/pull/1811
Looks like Rack::Files appeared in rack 2.1.0 according to
626272b2bc
Sinatra needs at least rack 2.2.4 (since v3.0.0) so this should be fine
This commit is contained in:
parent
e19cad1cb1
commit
e1c903621c
|
@ -291,7 +291,7 @@ module Sinatra
|
||||||
elsif value
|
elsif value
|
||||||
# Rack 2.0 returns a Rack::File::Iterator here instead of
|
# Rack 2.0 returns a Rack::File::Iterator here instead of
|
||||||
# Rack::File as it was in the previous API.
|
# 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'
|
headers.delete 'Content-Length'
|
||||||
end
|
end
|
||||||
response.body = value
|
response.body = value
|
||||||
|
@ -429,7 +429,7 @@ module Sinatra
|
||||||
|
|
||||||
last_modified opts[:last_modified] if opts[:last_modified]
|
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 = file.serving(request, path)
|
||||||
|
|
||||||
result[1].each { |k, v| headers[k] ||= v }
|
result[1].each { |k, v| headers[k] ||= v }
|
||||||
|
|
Loading…
Reference in New Issue