Skip to content

Commit fb48374

Browse files
committedJul 12, 2020
Fix a crash on webrick with Rack 2.2.3
1 parent b18a195 commit fb48374

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

‎lib/web_console/injector.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def inject(content)
1616
# Set Content-Length header to the size of the current body
1717
# + the extra content. Otherwise the response will be truncated.
1818
if @headers["Content-Length"]
19-
@headers["Content-Length"] = @body.bytesize + content.bytesize
19+
@headers["Content-Length"] = (@body.bytesize + content.bytesize).to_s
2020
end
2121

2222
[

‎test/web_console/injector_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class InjectorTest < ActiveSupport::TestCase
3232
body = [ "foo" ]
3333
headers = { "Content-Length" => 3 }
3434

35-
assert_equal [ [ "foobar" ], { "Content-Length" => 6 } ], Injector.new(body, headers).inject("bar")
35+
assert_equal [ [ "foobar" ], { "Content-Length" => "6" } ], Injector.new(body, headers).inject("bar")
3636
end
3737
end
3838
end

0 commit comments

Comments
 (0)
Please sign in to comment.