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, 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 45A0D2084A for ; Fri, 15 Apr 2016 23:33:33 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 3/4] www: redirect /$MESSAGE_ID/f/ endpoints Date: Fri, 15 Apr 2016 23:33:27 +0000 Message-Id: <20160415233328.16081-4-e@80x24.org> In-Reply-To: <20160415233328.16081-1-e@80x24.org> References: <20160413030411.1375-1-e@80x24.org> <20160415233328.16081-1-e@80x24.org> List-Id: 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 18b716c..3cf6ea8 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 2bf7cd5..ac44d44 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