From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F03801FBEC for ; Sun, 5 Mar 2017 02:06:47 +0000 (UTC) From: Eric Wong To: kcar-public@bogomips.org Subject: [PATCH] test_parser: add lone CR test Date: Sun, 5 Mar 2017 02:06:47 +0000 Message-Id: <20170305020647.2596-1-e@80x24.org> List-Id: Just out of paranoia... --- test/test_parser.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_parser.rb b/test/test_parser.rb index c8eaa4d..c0a05f1 100644 --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -254,6 +254,12 @@ class TestParser < Test::Unit::TestCase end end + def test_bad_cr + assert_raises(Kcar::ParserError) do + @hp.headers([], "HTTP/1.1 200 OK\r\nContent-Length: 5\r\nA:\rb") + end + end + def test_leading_tab resp = "HTTP/1.1 200 OK\r\nHost:\texample.com\r\n\r\n" assert @hp.headers(env = {}, resp) -- EW