From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6243C211BC for ; Sat, 1 Dec 2018 13:31:28 +0000 (UTC) From: Eric Wong To: kcar-public@bogomips.org Subject: [PATCH 09/11] do not set "HTTP/0.9" for pre-1.0 requests Date: Sat, 1 Dec 2018 13:31:23 +0000 Message-Id: <20181201133125.5524-10-e@80x24.org> In-Reply-To: <20181201133125.5524-1-e@80x24.org> References: <20181201133125.5524-1-e@80x24.org> List-Id: Since "HTTP/0.9" is an informal name, we'll omit it to avoid confusing any applications which may see them. --- ext/kcar/kcar.rl | 10 ---------- test/test_request_parser.rb | 2 -- 2 files changed, 12 deletions(-) diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl index e1445aa..c85eb3c 100644 --- a/ext/kcar/kcar.rl +++ b/ext/kcar/kcar.rl @@ -189,14 +189,6 @@ static void set_server_vars(struct http_parser *hp, VALUE env, VALUE host) rb_hash_aset(env, g_SERVER_PORT, server_port); } -static void http_09_request(VALUE env) -{ - VALUE v = str_new_dd_freeze("HTTP/0.9", 8); - - rb_hash_aset(env, g_SERVER_PROTOCOL, v); - rb_hash_aset(env, g_HTTP_VERSION, v); -} - static void finalize_header(struct http_parser *hp, VALUE hdr) { if (hp->has_trailer && !hp->chunked) @@ -215,8 +207,6 @@ static void finalize_header(struct http_parser *hp, VALUE hdr) VALUE host = request_host_val(hp); if (host != Qfalse) set_server_vars(hp, hdr, host); - } else { - http_09_request(hdr); } } } diff --git a/test/test_request_parser.rb b/test/test_request_parser.rb index c4fefc8..895a948 100644 --- a/test/test_request_parser.rb +++ b/test/test_request_parser.rb @@ -743,8 +743,6 @@ class TestRequestParser < Test::Unit::TestCase "REQUEST_PATH" => "/read-rfc1945-if-you-dont-believe-me", "PATH_INFO" => "/read-rfc1945-if-you-dont-believe-me", "REQUEST_URI" => "/read-rfc1945-if-you-dont-believe-me", - "SERVER_PROTOCOL" => "HTTP/0.9", - "HTTP_VERSION" => "HTTP/0.9", "REQUEST_METHOD" => "GET", "QUERY_STRING" => "" }