diff options
author | Eric Wong <e@80x24.org> | 2016-07-17 23:27:02 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-17 23:27:02 +0000 |
commit | 8888a03c12dcd0f17ff611f4617523942a3aed49 (patch) | |
tree | 6c00346873007b8510ccbef1d777678e6956f58a /lib/PublicInbox/ExtMsg.pm | |
parent | a8bb6e58a39b98fba6a15628cc3275586d30f17f (diff) | |
download | public-inbox-8888a03c12dcd0f17ff611f4617523942a3aed49.tar.gz |
While an inbox may have multiple URLs, we will favor the existing URL for the current inbox on partial matches to avoid confusing users or slowing them down by requiring a new TCP connection.
Diffstat (limited to 'lib/PublicInbox/ExtMsg.pm')
-rw-r--r-- | lib/PublicInbox/ExtMsg.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm index 2a9316b1..955ada7e 100644 --- a/lib/PublicInbox/ExtMsg.pm +++ b/lib/PublicInbox/ExtMsg.pm @@ -108,9 +108,11 @@ again: $code = 300; my $es = $n_partial == 1 ? '' : 'es'; $s .= "\n$n_partial partial match$es found:\n\n"; + my $cur_name = $cur->{name}; foreach my $pair (@partial) { my ($ibx, $res) = @$pair; - my $u = $ibx->base_url or next; + my $env = $ctx->{env} if $ibx->{name} eq $cur_name; + my $u = $ibx->base_url($env) or next; foreach my $m (@$res) { my $p = PublicInbox::Hval->new_msgid($m); my $r = $p->as_href; |