about summary refs log tree commit homepage
path: root/lib/PublicInbox/NewsWWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-05-27 08:57:42 +0000
committerEric Wong <e@80x24.org>2016-05-27 09:03:32 +0000
commit0b1c6867ee10d9edcbd75c359cb23c75b732682e (patch)
tree7b880ad31530d46ed6343e9e283a5ad18aa70140 /lib/PublicInbox/NewsWWW.pm
parent3344815088512287243b622658dbb7fbea87beb1 (diff)
downloadpublic-inbox-0b1c6867ee10d9edcbd75c359cb23c75b732682e.tar.gz
Oops, added a test to prevent regressions while we're at it.
Diffstat (limited to 'lib/PublicInbox/NewsWWW.pm')
-rw-r--r--lib/PublicInbox/NewsWWW.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/NewsWWW.pm b/lib/PublicInbox/NewsWWW.pm
index 19eb596c..5357059d 100644
--- a/lib/PublicInbox/NewsWWW.pm
+++ b/lib/PublicInbox/NewsWWW.pm
@@ -30,7 +30,6 @@ sub call {
         if (my $info = $ng_map->{$ng}) {
                 my $url = PublicInbox::Hval::prurl($env, $info->{url});
                 my $code = 301;
-                my $h = [ Location => $url, 'Content-Type' => 'text/plain' ];
                 if (defined $article && $article =~ /\A\d+\z/) {
                         my $mid = eval { ng_mid_for($ng, $info, $article) };
                         if (defined $mid) {
@@ -41,6 +40,8 @@ sub call {
                         }
                 }
 
+                my $h = [ Location => $url, 'Content-Type' => 'text/plain' ];
+
                 return [ $code, $h, [ "Redirecting to $url\n" ] ]
         }
         [ 404, [ 'Content-Type' => 'text/plain' ], [] ];