-# Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Plack app redirector for mapping /$NEWSGROUP requests to
# some links may have the article number in them:
# /inbox.foo.bar/123456
my (undef, @parts) = split(m!/!, $env->{PATH_INFO});
+ @parts or return
+ [ 404, [qw(Content-Type text/plain)], ["404 Not Found\n"] ];
my ($ng, $article) = @parts;
my $pi_cfg = $self->{pi_cfg};
if (my $ibx = $pi_cfg->lookup_newsgroup($ng)) {
for (@$xr3) {
s/:[0-9]+:$x->{blob}\z// or next;
my $ibx = $by_eidx_key->{$_} // next;
- my $url = $ibx->base_url or next;
+ my $url = $ALL->base_url($env) //
+ $ibx->base_url // next;
$url .= mid_escape($mid) . '/';
return redirect(302, $url);
}