From 037145fecda6383f6d119893015c77ab4d86daf3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 25 Sep 2015 02:27:50 +0000 Subject: nntp: HDR allows metadata prefixed with ':' 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(-) (limited to 'lib') 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; -- cgit v1.2.3-24-ge0c7