Skip to content

Commit f2d442e

Browse files
committed
one line is enough ... lines -= 5
1 parent 620ac03 commit f2d442e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class JRuby::Rack::ErrorApp
55
# catches empty responses and replaces them with a site explaining the error.
66
#
77
# @note kindly adapted from on Rack::ShowStatus
8-
# @private internal API - likely won't exist in 1.2.x
8+
# @private internal API - likely won't exist in 1.2
99
class ShowStatus
1010

1111
def initialize(app)
@@ -36,12 +36,7 @@ def call(env)
3636

3737
# @private
3838
def h(obj)
39-
case obj
40-
when String
41-
Utils.escape_html(obj)
42-
else
43-
Utils.escape_html(obj.inspect)
44-
end
39+
obj.is_a?(String) ? Utils.escape_html(obj) : Utils.escape_html(obj.inspect)
4540
end
4641

4742
# :stopdoc:

0 commit comments

Comments
 (0)