user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 3/3] www: move fallback after legacy matches
  @ 2015-09-03  8:32  7% ` Eric Wong
  0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2015-09-03  8:32 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply related	[relevance 7%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-09-03  8:32     [PATCH 1/3] examples/public-inbox.psgi: update with middlewares Eric Wong
2015-09-03  8:32  7% ` [PATCH 3/3] www: move fallback after legacy matches Eric Wong

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).