filter_innd: Correctly read folded headers.

Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
Thomas Hochstein 2023-05-20 15:32:12 +02:00
parent 121fcbc15f
commit 0ed9a8166d

View file

@ -1,4 +1,4 @@
# vim: set syntax=perl ts=4 ai si: # vim: set tabstop=4 shiftwidth=4 expandtab syntax=perl:
use MIME::Base64(); use MIME::Base64();
use Digest::SHA(); use Digest::SHA();
@ -36,10 +36,13 @@ sub verify_cancel($$$) {
for my $line(split(/\s*\n/, $headers)) { for my $line(split(/\s*\n/, $headers)) {
if ($line =~ m/^([[:alnum:]-]+):\s+(.*)/) { if ($line =~ m/^([[:alnum:]-]+):\s+(.*)/) {
$headers{$1} = $2; $headers{$1} = $2;
$lastkey = $1;
} elsif ($line =~ m/^\s+(.*)/ and defined($lastkey)) {
$headers{$lastkey} .= ' ' . $1;
} }
} }
my $lock = $headers{'Cancel-Lock'}; my $lock = $headers{'Cancel-Lock'};
if (defined($lock)) { if (defined($lock)) {
my $key = $r_hdr->{'Cancel-Key'} || return "$descr of $target without Cancel-Key"; my $key = $r_hdr->{'Cancel-Key'} || return "$descr of $target without Cancel-Key";
#return verify_cancel_key($key, $lock, ' target=' . $target); #return verify_cancel_key($key, $lock, ' target=' . $target);