about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-01-30 09:19:06 +0000
committerEric Wong <e@yhbt.net>2020-01-31 23:00:07 +0000
commit31cb75037a757c9388f74283a8b1ecb7c5b65f24 (patch)
tree6989f99a3cb00272ff877218ebad85fabe0da903 /t
parent3dff4a5399f10cbcb3d902da094680705c50193a (diff)
downloadpublic-inbox-31cb75037a757c9388f74283a8b1ecb7c5b65f24.tar.gz
Lets always have Content-Disposition for files intended
to be downloaded for consumption by non-browsers, such
as pigz, zcat, "git am".

This is also to be consistent with the non-gzipped mbox
$MESSAGE_ID/raw endpoint.
Diffstat (limited to 't')
-rw-r--r--t/psgi_search.t6
1 files changed, 6 insertions, 0 deletions
diff --git a/t/psgi_search.t b/t/psgi_search.t
index 56b42118..4ff25eb2 100644
--- a/t/psgi_search.t
+++ b/t/psgi_search.t
@@ -107,6 +107,12 @@ test_psgi(sub { $www->call(@_) }, sub {
                 'subject-less message linked from "/$INBOX/?q=..."');
         like($html, qr/\bhref="blank-subject[^>]+>\(no subject\)</,
                 'blank subject message linked from "/$INBOX/?q=..."');
+        $res = $cb->(GET('/test/no-subject-at-all@example.com/raw'));
+        like($res->header('Content-Disposition'),
+                qr/filename=no-subject\.txt/);
+        $res = $cb->(GET('/test/no-subject-at-all@example.com/t.mbox.gz'));
+        like($res->header('Content-Disposition'),
+                qr/filename=no-subject\.mbox\.gz/);
 });
 
 done_testing();