]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntp: header responses use CRLF consistently
authorEric Wong <e@80x24.org>
Wed, 16 Jan 2019 04:51:28 +0000 (04:51 +0000)
committerEric Wong <e@80x24.org>
Wed, 16 Jan 2019 04:51:28 +0000 (04:51 +0000)
Alpine is apparently stricter than other clients I've tried
w.r.t. using CRLF for headers.  So do the same thing we do for
bodies to ensure we only emit CRLFs and no bare LFs.

Reported-by: Wang Kang <i@scateu.me>
  https://public-inbox.org/meta/alpine.DEB.2.21.99.1901161043430.29788@la.scateu.me/

lib/PublicInbox/NNTP.pm

index 623ffd35c172ba85d7204570be33b6b563bf501b..63d5870b045756463b8d78f7b16c4689481a15be 100644 (file)
@@ -515,6 +515,7 @@ sub set_art {
 sub _header ($) {
        my $hdr = $_[0]->header_obj->as_string;
        utf8::encode($hdr);
+       $hdr =~ s/(?<!\r)\n/\r\n/sg;
        $hdr
 }