It should be possible to serve the contents of a public-inbox
over NNTP but not HTTP.
} else {
# either called from a non-PSGI environment (e.g. NNTP/POP3)
$self->{-base_url} ||= do {
- my $url = $self->{url};
+ my $url = $self->{url} or return undef;
# expand protocol-relative URLs to HTTPS if we're
# not inside a web server
$url = "https:$url" if $url =~ m!\A//!;
$x = PublicInbox::Inbox->new({url => 'http://example.com/test'});
is($x->base_url, 'http://example.com/test/', 'added trailing slash');
+$x = PublicInbox::Inbox->new({});
+is($x->base_url, undef, 'undef base_url allowed');
+
done_testing();