From 98352cd1c066d8cc16594f000509997cfd590985 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 10 Apr 2014 20:12:03 +0000 Subject: cgi: update feed/view and tests for shorter URLs Code should be consistent with the design docs (and we will need better tests). --- lib/PublicInbox/Feed.pm | 8 ++++---- t/cgi.t | 2 +- t/view.t | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index da4cc04a..75e5d953 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -127,8 +127,8 @@ sub get_feedopts { $rv{atomurl} = "$url_base/index.atom.xml"; } $rv{url} ||= "$url_base/"; - $rv{midurl} = "$url_base/mid/"; - $rv{fullurl} = "$url_base/full/"; + $rv{midurl} = "$url_base/m/"; + $rv{fullurl} = "$url_base/f/"; \%rv; } @@ -162,8 +162,8 @@ sub add_to_feed { return 0; } - my $midurl = $feed_opts->{midurl} || 'http://example.com/mid/'; - my $fullurl = $feed_opts->{fullurl} || 'http://example.com/full/'; + my $midurl = $feed_opts->{midurl} || 'http://example.com/m/'; + my $fullurl = $feed_opts->{fullurl} || 'http://example.com/f/'; my $content = PublicInbox::View->as_feed_entry($mime, $fullurl); defined($content) or return 0; diff --git a/t/cgi.t b/t/cgi.t index 93a48d00..2c4c824c 100644 --- a/t/cgi.t +++ b/t/cgi.t @@ -106,7 +106,7 @@ EOF like($res->{body}, qr/test for public-inbox/, "set title in XML feed"); like($res->{body}, - qr!http://test\.example\.com/test/mid/blah%40example\.com!, + qr!http://test\.example\.com/test/m/blah%40example\.com!, "link id set"); like($res->{body}, qr/what\?/, "reply included"); diff --git a/t/view.t b/t/view.t index fbdbd884..ad79c413 100644 --- a/t/view.t +++ b/t/view.t @@ -40,7 +40,7 @@ EOF "long quoted text is anchored"); # short page - my $pfx = "http://example.com/test/full"; + my $pfx = "http://example.com/test/f"; my $short = PublicInbox::View->as_html($s, $pfx); like($short, qr/\n> keep this inline/, "short quoted text is inline"); -- cgit v1.2.3-24-ge0c7