]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NewsWWW.pm
wwwstream: improve documentation and variable naming
[public-inbox.git] / lib / PublicInbox / NewsWWW.pm
index 908c43510dbd8f41bf6ce48dfb2e6212e771fcff..b4d747633fc378146c9439c6c5b8af1a1bcb83c9 100644 (file)
@@ -9,7 +9,7 @@ package PublicInbox::NewsWWW;
 use strict;
 use warnings;
 use PublicInbox::Config;
-use URI::Escape qw(uri_escape_utf8);
+use PublicInbox::MID qw(mid_escape);
 
 sub new {
        my ($class, $pi_config) = @_;
@@ -35,7 +35,7 @@ sub call {
                                # article IDs are not stable across clones,
                                # do not encourage caching/bookmarking them
                                $code = 302;
-                               $url .= uri_escape_utf8($mid) . '/';
+                               $url .= mid_escape($mid) . '/';
                        }
                }
 
@@ -43,7 +43,7 @@ sub call {
 
                return [ $code, $h, [ "Redirecting to $url\n" ] ]
        }
-       [ 404, [ 'Content-Type' => 'text/plain' ], [] ];
+       [ 404, [ 'Content-Type' => 'text/plain' ], [ "404 Not Found\n" ] ];
 }
 
 1;