diff options
author | Eric Wong <e@80x24.org> | 2021-09-07 14:05:48 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-09-07 21:01:23 +0000 |
commit | 083568c68cf37e945c95cd238a9beae1faad9bea (patch) | |
tree | 19e4fcb805378a95d4936816db5bff4c6764fd9e /lib | |
parent | f2aaef1b7e84aec38b88dce88ad2f5a86f33f684 (diff) | |
download | public-inbox-083568c68cf37e945c95cd238a9beae1faad9bea.tar.gz |
PATH_INFO may not have enough slashes for newsgroup name in the URL at all, so ensure we don't try to further process requests which have no chance of having a newsgroup name.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/NewsWWW.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/NewsWWW.pm b/lib/PublicInbox/NewsWWW.pm index d7dd637f..abafc4f9 100644 --- a/lib/PublicInbox/NewsWWW.pm +++ b/lib/PublicInbox/NewsWWW.pm @@ -45,6 +45,8 @@ sub call { # 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)) { |