From 1988d730c0088e8b1f6193650c7ee929df8a2ed7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Jan 2020 03:09:30 +0000 Subject: config: support multi-value inbox.*.*url Since the beginning of this project, we've implicitly supported inboxes with multiple URLs by relying on the Host: header sent by the client ($env->{HTTP_HOST}). We now offer the option to explicitly configure multiple URLs for every inbox along with the ability to do a best-effort match for matching hostnames. --- lib/PublicInbox/Inbox.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Inbox.pm') diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index f294c0d5..a3cdcbc0 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -252,7 +252,7 @@ sub base_url { } else { # either called from a non-PSGI environment (e.g. NNTP/POP3) $self->{-base_url} ||= do { - my $url = $self->{url} or return undef; + my $url = $self->{url}->[0] or return undef; # expand protocol-relative URLs to HTTPS if we're # not inside a web server $url = "https:$url" if $url =~ m!\A//!; -- cgit v1.2.3-24-ge0c7