about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-05-07 21:05:49 +0000
committerEric Wong <e@yhbt.net>2020-05-09 08:59:10 +0000
commit3b1b7abf814dbc7f2a737b2ca0e12b0fa518ff44 (patch)
treecde4545eac215cffda996d8aea47791f6d2e3095 /lib/PublicInbox/WWW.pm
parent57af9c8d0bedafac3267b5b42f963bb8aa5c2ea1 (diff)
downloadpublic-inbox-3b1b7abf814dbc7f2a737b2ca0e12b0fa518ff44.tar.gz
Since PublicInbox::Eml doesn't parse MIME subparts
up front, it can replace most uses of Email::Simple
without performance penalty.

This will eventually allow us to lower overall internal
API footprint by not having to keep the MIME vs Simple
distinction.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index 3a428218..1ff857de 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -22,6 +22,7 @@ use PublicInbox::MID qw(mid_escape);
 use PublicInbox::GitHTTPBackend;
 use PublicInbox::UserContent;
 use PublicInbox::WwwStatic qw(r path_info_raw);
+use PublicInbox::Eml;
 
 # TODO: consider a routing tree now that we have more endpoints:
 our $INBOX_RE = qr!\A/([\w\-][\w\.\-]*)!;
@@ -231,9 +232,8 @@ sub invalid_inbox_mid {
                 my ($x2, $x38) = ($1, $2);
                 # this is horrifically wasteful for legacy URLs:
                 my $str = $ctx->{-inbox}->msg_by_path("$x2/$x38") or return;
-                require Email::Simple;
-                my $s = Email::Simple->new($str);
-                $mid = PublicInbox::MID::mid_clean($s->header('Message-ID'));
+                my $s = PublicInbox::Eml->new($str);
+                $mid = PublicInbox::MID::mid_clean($s->header_raw('Message-ID'));
                 return r301($ctx, $inbox, mid_escape($mid));
         }
         undef;