diff options
author | Eric Wong <e@80x24.org> | 2015-08-27 04:33:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-27 06:04:51 +0000 |
commit | 6fb2cbb34be7376a24bd00e0f8fd20114c18318c (patch) | |
tree | ec874cc24a3c37b2937f332962c0b64d78b37274 /t | |
parent | ded3c261112acf925567507959319a8442a3b647 (diff) | |
download | public-inbox-6fb2cbb34be7376a24bd00e0f8fd20114c18318c.tar.gz |
We will prefer URLs without suffixes for now to avoid ambiguity in case a Message-ID ends with ".html", ".txt", ".mbox.gz" or any other suffix we may use. Static file compatibility is preserved by using a trailing slash as most servers can/will fall back to an index.html file in this case. For raw text files, we will follow gmane's lead with "/raw"
Diffstat (limited to 't')
-rw-r--r-- | t/cgi.t | 2 | ||||
-rw-r--r-- | t/plack.t | 19 |
2 files changed, 20 insertions, 1 deletions
@@ -183,7 +183,7 @@ EOF { local $ENV{HOME} = $home; local $ENV{PATH} = $main_path; - my $path = "/test/t/blahblah%40example.com.mbox.gz"; + my $path = "/test/t/blahblah%40example.com/mbox.gz"; my $res = cgi_run($path); like($res->{head}, qr/^Status: 501 /, "search not-yet-enabled"); my $indexed = system($index, $maindir) == 0; @@ -101,6 +101,25 @@ EOF qr!link\s+href="\Q$pfx\E/m/blah%40example\.com\.html"!s, 'atom feed generated correct URL'); }); + + foreach my $t (qw(f m)) { + test_psgi($app, sub { + my ($cb) = @_; + my $pfx = 'http://example.com/test'; + my $path = "/$t/blah%40example.com/"; + my $res = $cb->(GET($pfx . $path)); + is(200, $res->code, "success for $path"); + like($res->content, qr!<title>hihi - Me</title>!, + "HTML returned"); + }); + } + test_psgi($app, sub { + my ($cb) = @_; + my $pfx = 'http://example.com/test'; + my $res = $cb->(GET($pfx . '/m/blah%40example.com/raw')); + is(200, $res->code, 'success response received for /m/*/raw'); + like($res->content, qr!\AFrom !, "mbox returned"); + }); } done_testing(); |