From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, T_RP_MATCHES_RCVD,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4E9BA633862 for ; Thu, 3 Sep 2015 08:32:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/3] www: move fallback after legacy matches Date: Thu, 3 Sep 2015 08:32:26 +0000 Message-Id: <1441269146-2458-3-git-send-email-e@80x24.org> In-Reply-To: <1441269146-2458-1-git-send-email-e@80x24.org> References: <1441269146-2458-1-git-send-email-e@80x24.org> List-Id: We do not want to get legacy URLs swallowed up by our workaround for weird and wonky servers that attempt to unescape PATH_INFO before the app sees it. --- lib/PublicInbox/WWW.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 6eebf62..e8b35cb 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -42,11 +42,6 @@ sub run { } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/$END_RE\z!o) { msg_page($ctx, $1, $2, $3); - # some Message-IDs have slashes in them and the HTTP server - # may try to be clever and unescape them :< - } elsif ($path_info =~ m!$LISTNAME_RE/(\S+/\S+)/$END_RE\z!o) { - msg_page($ctx, $1, $2, $3); - # convenience redirects order matters } elsif ($path_info =~ m!$LISTNAME_RE/([^/]{2,})\z!o) { r301($ctx, $1, $2); @@ -354,6 +349,11 @@ sub legacy_redirects { } elsif ($path_info =~ m!$LISTNAME_RE/f/(\S+)\z!o) { r301($ctx, $1, $2, 'f/'); + # some Message-IDs have slashes in them and the HTTP server + # may try to be clever and unescape them :< + } elsif ($path_info =~ m!$LISTNAME_RE/(\S+/\S+)/$END_RE\z!o) { + msg_page($ctx, $1, $2, $3); + } else { r404(); } -- EW