From: Eric Wong Date: Fri, 25 Sep 2015 02:27:50 +0000 (+0000) Subject: nntp: HDR allows metadata prefixed with ':' X-Git-Tag: v1.0.0~833 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=037145fecda6383f6d119893015c77ab4d86daf3;p=public-inbox.git nntp: HDR allows metadata prefixed with ':' RFC 3977, section 8.5.2 states metadata lookups can be done with HDR. --- diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 6c661a1b..c2f97177 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;