diff options
author | Eric Wong <e@80x24.org> | 2014-04-28 20:47:33 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2014-04-28 20:47:33 +0000 |
commit | 617292c6b00b214215e401229cf5046f08b0bbba (patch) | |
tree | 33af329957f662779457b1d2758f28bee22b770e /public-inbox.cgi | |
parent | 02a8a6dfa6e039ea0df5641ccc250ff346ec0008 (diff) | |
download | public-inbox-617292c6b00b214215e401229cf5046f08b0bbba.tar.gz |
We only generate URI-escaped URLs, so we should not be decoding this into octets.
Diffstat (limited to 'public-inbox.cgi')
-rwxr-xr-x | public-inbox.cgi | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/public-inbox.cgi b/public-inbox.cgi index 7f7e59ca..7da73754 100755 --- a/public-inbox.cgi +++ b/public-inbox.cgi @@ -13,10 +13,8 @@ use 5.008; use strict; use warnings; use CGI qw(:cgi -nosticky); # PSGI/FastCGI/mod_perl compat -use Encode qw(find_encoding); use PublicInbox::Config; use URI::Escape qw(uri_escape_utf8 uri_unescape); -our $enc_utf8 = find_encoding('UTF-8'); our $LISTNAME_RE = qr!\A/([\w\.\-]+)!; our $pi_config; BEGIN { @@ -53,10 +51,10 @@ sub main { if ($method !~ /\AGET|HEAD\z/) { return r(405, 'Method Not Allowed'); } - my $path_info = $enc_utf8->decode($cgi->path_info); + my $path_info = $cgi->path_info; # top-level indices and feeds - if ($path_info eq "/") { + if ($path_info eq '/') { r404(); } elsif ($path_info =~ m!$LISTNAME_RE\z!o) { invalid_list(\%ctx, $1) || redirect_list_index(\%ctx, $cgi); |