about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-06-13 22:43:56 +0000
committerEric Wong <e@80x24.org>2018-06-26 07:39:58 +0000
commit73cfed86d8a8287a84221e0c79b60e03cb88a9ce (patch)
treea85c35b82af5cb70ed3076b69d10c2bd7e67b107 /t
parentc33472811331a6134b796f1889d87f7decf4c831 (diff)
downloadpublic-inbox-73cfed86d8a8287a84221e0c79b60e03cb88a9ce.tar.gz
In PSGI, PATH_INFO contains URI-decoded paths which cause
problems when Message-IDs contain ambiguous characters for used
for routing.  Instead, extract the undecoded path from
REQUEST_URI and use that.

Reported-by: Leah Neukirchen <leah@vuxu.org>
  https://public-inbox.org/meta/8736xsb5s5.fsf@vuxu.org/
Diffstat (limited to 't')
-rw-r--r--t/cgi.t2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/cgi.t b/t/cgi.t
index bd92ca36..2e2476d7 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -225,6 +225,8 @@ sub cgi_run {
         my %env = (
                 PATH_INFO => $_[0],
                 QUERY_STRING => $_[1] || "",
+                SCRIPT_NAME => '',
+                REQUEST_URI => $_[0] . ($_[1] ? "?$_[1]" : ''),
                 REQUEST_METHOD => $_[2] || "GET",
                 GATEWAY_INTERFACE => 'CGI/1.1',
                 HTTP_ACCEPT => '*/*',