user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] www: do not unescape PATH_INFO twice
Date: Tue, 14 Feb 2017 22:46:07 +0000	[thread overview]
Message-ID: <20170214224607.13769-1-e@80x24.org> (raw)

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


                 reply	other threads:[~2017-02-14 22:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170214224607.13769-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).