summaryrefslogtreecommitdiff
path: root/test/webrick/test_httprequest.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-24 07:48:33 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-24 07:48:33 +0000
commit1aef602d5a9398ff362de212ae402ffcd8ff76ae (patch)
tree26ef45af6b246709fe73e6189b1d16e2704758db /test/webrick/test_httprequest.rb
parentd54d9ba7de7094698e7009a171df013821c3b0d1 (diff)
webrick: raise EOFError in parse when read line is nil
[Bug #15146] From: Justin Li <git@justinli.net> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick/test_httprequest.rb')
-rw-r--r--test/webrick/test_httprequest.rb7
1 files changed, 7 insertions, 0 deletions
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