From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0696E1FAF4 for ; Tue, 14 Feb 2017 22:46:07 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] www: do not unescape PATH_INFO twice Date: Tue, 14 Feb 2017 22:46:07 +0000 Message-Id: <20170214224607.13769-1-e@80x24.org> List-Id: PSGI specs already require PATH_INFO to be unescaped; so our tests were wrong, too. --- lib/PublicInbox/WWW.pm | 2 +- t/cgi.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 430e6b1..62e4ca4 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -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 092ad8c..7740966 100644 --- 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"); -- EW