From fdf9b900b8c35cb4259dbdf56400d44db61e7a9e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 15 Apr 2016 20:50:56 +0000 Subject: www: redirect /$MESSAGE_ID/f/ endpoints Quote-folding was a major design mistake pre-1.0. Since this project is still in its infancy and unlikely to be in wide use at the moment, redirect the /f/ endpoints back to the plain message. --- Documentation/design_www.txt | 6 ++++-- lib/PublicInbox/View.pm | 27 +++++++++++++-------------- lib/PublicInbox/WWW.pm | 38 ++++++++++++++++---------------------- t/cgi.t | 8 +++++--- t/plack.t | 32 +++++++++++++++++++------------- t/view.t | 2 +- 6 files changed, 58 insertions(+), 55 deletions(-) diff --git a/Documentation/design_www.txt b/Documentation/design_www.txt index 18b716c7..3cf6ea85 100644 --- a/Documentation/design_www.txt +++ b/Documentation/design_www.txt @@ -27,12 +27,14 @@ URL and anchor naming /$LISTNAME/$MESSAGE_ID/raw -> raw mbox /$LISTNAME/$MESSAGE_ID/R/ -> HTML reply instructions +# Covering up a pre-1.0 design mistake: +/$LISTNAME/$MESSAGE_ID/f/ -> 301 to /$LISTNAME/$MESSAGE_ID/ + ### Legacy endpoints (may be ambiguous given Message-IDs with similar suffixes) -/$LISTNAME/$MESSAGE_ID/f/ -> HTML content /$LISTNAME/m/$MESSAGE_ID/ -> 301 to /$LISTNAME/$MESSAGE_ID/ /$LISTNAME/m/$MESSAGE_ID.html -> 301 to /$LISTNAME/$MESSAGE_ID/ /$LISTNAME/m/$MESSAGE_ID.txt -> 301 to /$LISTNAME/$MESSAGE_ID/raw -/$LISTNAME/f/$MESSAGE_ID.html -> 301 to /$LISTNAME/$MESSAGE_ID/f/ +/$LISTNAME/f/$MESSAGE_ID.html -> 301 to /$LISTNAME/$MESSAGE_ID/ /$LISTNAME/f/$MESSAGE_ID.txt [1] -> 301 to /$LISTNAME/$MESSAGE_ID/raw /$LISTNAME/atom.xml [2] -> identical to /$LISTNAME/new.atom diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2bf7cd50..ac44d442 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -22,13 +22,13 @@ my $enc_utf8 = find_encoding('UTF-8'); # public functions: sub msg_html { - my ($ctx, $mime, $full_pfx, $footer) = @_; + my ($ctx, $mime, $footer) = @_; $footer = defined($footer) ? "\n$footer" : ''; my $hdr = $mime->header_obj; - headers_to_html_header($hdr, $full_pfx, $ctx) . - multipart_text_as_html($mime, $full_pfx) . + headers_to_html_header($hdr, $ctx) . + multipart_text_as_html($mime) . '
' .
-		html_footer($hdr, 1, $full_pfx, $ctx) .
+		html_footer($hdr, 1, $ctx) .
 		$footer .
 		'
'; } @@ -72,11 +72,10 @@ sub msg_reply { } sub feed_entry { - my ($class, $mime, $full_pfx) = @_; + my ($class, $mime) = @_; # no here for