diff options
author | Eric Wong <e@80x24.org> | 2020-09-10 09:38:39 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-09-10 19:04:40 +0000 |
commit | 305d728977def1df9ab57778f9cad9dd834ce73d (patch) | |
tree | cf3f45a47a3aae9eebfa73008f293ff568a1d5f3 /t/nntp.t | |
parent | 4e60d74e6cab0a134c0c62785c766b5fa02ac360 (diff) | |
download | public-inbox-305d728977def1df9ab57778f9cad9dd834ce73d.tar.gz |
We cannot blindly use the selected newsgroup for HEAD/ARTICLE/BODY requests using Message-ID, since those commands look across all newsgroups; not just the selected one (if any). So stuff a reference to the Inbox object into $smsg. We can reduce args passed into set_nntp_headers() and msg_hdr_write(), too. Fixes: 0e6ceff37fc38f28 ("nntp: support slow blob retrievals")
Diffstat (limited to 't/nntp.t')
-rw-r--r-- | t/nntp.t | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -113,8 +113,8 @@ use_ok 'PublicInbox::Inbox'; nntpd => { grouplist => [], servername => 'example.com' }, ng => $ng, }; - my $smsg = { num => 1, mid => $mid }; - PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg); + my $smsg = { num => 1, mid => $mid, nntp => $mock_self, -ibx => $ng }; + PublicInbox::NNTP::set_nntp_headers($hdr, $smsg); is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ], 'Message-ID unchanged'); is_deeply([ $mime->header('Archived-At') ], [ "<${u}a\@b/>" ], @@ -130,7 +130,7 @@ use_ok 'PublicInbox::Inbox'; $ng->{-base_url} = 'http://mirror.example.com/m/'; $smsg->{num} = 2; - PublicInbox::NNTP::set_nntp_headers($mock_self, $hdr, $smsg); + PublicInbox::NNTP::set_nntp_headers($hdr, $smsg); is_deeply([ $mime->header('Message-ID') ], [ "<$mid>" ], 'Message-ID unchanged'); is_deeply([ $mime->header('Archived-At') ], |