From 1aef602d5a9398ff362de212ae402ffcd8ff76ae Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 24 Sep 2018 07:48:33 +0000 Subject: webrick: raise EOFError in parse when read line is nil [Bug #15146] From: Justin Li git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_httprequest.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/webrick') diff --git a/test/webrick/test_httprequest.rb b/test/webrick/test_httprequest.rb index 6b99e34569..678efed1ca 100644 --- a/test/webrick/test_httprequest.rb +++ b/test/webrick/test_httprequest.rb @@ -422,4 +422,11 @@ GET / req.body } end + + def test_eof_raised_when_line_is_nil + assert_raise(WEBrick::HTTPStatus::EOFError) { + req = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP) + req.parse(StringIO.new("")) + } + end end -- cgit v1.2.3