]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: do not unescape PATH_INFO twice
authorEric Wong <e@80x24.org>
Tue, 14 Feb 2017 22:45:15 +0000 (22:45 +0000)
committerEric Wong <e@80x24.org>
Tue, 14 Feb 2017 22:46:28 +0000 (22:46 +0000)
PSGI specs already require PATH_INFO to be unescaped;
so our tests were wrong, too.

lib/PublicInbox/WWW.pm
t/cgi.t

index 430e6b19a02075aeb9c71f6bfd9f5b7ac1c3e782..62e4ca43511fc4962cbba6b59b0cdab18444fd99 100644 (file)
@@ -165,7 +165,7 @@ sub invalid_inbox_mid {
        my $ret = invalid_inbox($ctx, $inbox);
        return $ret if $ret;
 
-       $ctx->{mid} = $mid = uri_unescape($mid);
+       $ctx->{mid} = $mid;
        if ($mid =~ /\A[a-f0-9]{40}\z/) {
                # this is horiffically wasteful for legacy URLs:
                if ($mid = mid2blob($ctx)) {
diff --git a/t/cgi.t b/t/cgi.t
index 092ad8c7ca05a4f38040bd2b35efb71fa2ebca3e..77409660d96d279305520eebfad083b74288e959 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -148,7 +148,7 @@ EOF
        $im->add($reply);
        $im->done;
 
-       my $res = cgi_run("/test/slashy%2fasdf\@example.com/raw");
+       my $res = cgi_run("/test/slashy/asdf\@example.com/raw");
        like($res->{body}, qr/Message-Id: <\Q$slashy_mid\E>/,
                "slashy mid raw hit");