Skip to content

Commit 67e0ace

Browse files
committed
[chore] Remove pre Rack 2.2 backward compat code on ::Rack::Mime
1 parent 6ea65a3 commit 67e0ace

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main/ruby/jruby/rack/error_app.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ def serve(code, path, env)
8383
DEFAULT_HEADERS.each { |field, content| headers[field] = content }
8484
ext = File.extname(path)
8585
size = File.size?(path)
86-
mime = ::Rack::Mime.mime_type(ext, DEFAULT_MIME) if defined?(::Rack::Mime)
87-
mime = 'text/html' if ! mime && ( ext == '.html' || ext == '.htm' )
88-
headers['Content-Type'] = mime if mime
86+
mime = ::Rack::Mime.mime_type(ext, DEFAULT_MIME)
87+
headers['Content-Type'] = mime
8988

9089
body = env['REQUEST_METHOD'] == 'HEAD' ? [] : FileBody.new(path, size)
9190
response = [ code, headers, body ]

0 commit comments

Comments
 (0)