about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 07:31:54 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 07:31:54 +0000
commitd95eee4a10bdb9d30a6aeb93b475250e02109506 (patch)
treee4dfedae1094ff0ac28adc0f645e9ceeec6e37de
parentaa3e1126d751560e8648ebc54f22401f183f9572 (diff)
downloadpublic-inbox-d95eee4a10bdb9d30a6aeb93b475250e02109506.tar.gz
This is to make SearchMsg behave more sanely under NNTP.
-rw-r--r--lib/PublicInbox/V2Writable.pm2
-rw-r--r--t/v2writable.t8
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm
index 6d738278..c73d859b 100644
--- a/lib/PublicInbox/V2Writable.pm
+++ b/lib/PublicInbox/V2Writable.pm
@@ -142,7 +142,7 @@ sub num_for_harder {
                 }
         }
         my @cur = $hdr->header_raw('Message-Id');
-        $hdr->header_set('Message-Id', @cur, "<$mid>");
+        $hdr->header_set('Message-Id', "<$mid>", @cur);
         $num;
 }
 
diff --git a/t/v2writable.t b/t/v2writable.t
index 44191c13..f95b2e74 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -53,8 +53,8 @@ ok($im->add($mime), 'ordinary message added');
         ok($im->add($mime), 'reused mid ok');
         like(join(' ', @warn), qr/reused/, 'warned about reused MID');
         my @mids = $mime->header_obj->header_raw('Message-Id');
-        is($mids[0], '<a-mid@b>', 'original mid not changed');
-        like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added');
+        is($mids[1], '<a-mid@b>', 'original mid not changed');
+        like($mids[0], qr/\A<\w+\@localhost>\z/, 'new MID added');
         is(scalar(@mids), 2, 'only one new MID added');
 
         @warn = ();
@@ -68,8 +68,8 @@ ok($im->add($mime), 'ordinary message added');
         ok($im->add($mime), 'random MID made');
         like(join(' ', @warn), qr/using random/, 'warned about using random');
         @mids = $mime->header_obj->header_raw('Message-Id');
-        is($mids[0], '<a-mid@b>', 'original mid not changed');
-        like($mids[1], qr/\A<\w+\@localhost>\z/, 'new MID added');
+        is($mids[1], '<a-mid@b>', 'original mid not changed');
+        like($mids[0], qr/\A<\w+\@localhost>\z/, 'new MID added');
         is(scalar(@mids), 2, 'only one new MID added');
 
         @warn = ();