From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 8CA2F1FE1C for ; Fri, 25 Sep 2015 02:27:59 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/8] nntp: HDR allows metadata prefixed with ':' Date: Fri, 25 Sep 2015 02:27:50 +0000 Message-Id: <20150925022757.6915-2-e@80x24.org> In-Reply-To: <20150925022757.6915-1-e@80x24.org> References: <20150925022757.6915-1-e@80x24.org> List-Id: RFC 3977, section 8.5.2 states metadata lookups can be done with HDR. --- lib/PublicInbox/NNTP.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 6c661a1..c2f9717 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -480,9 +480,8 @@ sub get_range ($$) { sub hdr_val ($$) { my ($r, $header) = @_; - $header = lc $header; - return $r->[3] if ($header eq 'bytes'); - return $r->[4] if ($header eq 'lines'); + return $r->[3] if $header =~ /\A:?bytes\z/i; + return $r->[4] if $header =~ /\A:?lines\z/i; $r = $r->[2]->header_obj->header($header); defined $r or return; $r =~ s/[\r\n\t]+/ /sg; -- EW