From ec24b4af88d7922e4bf9846e76b9455fb6a5bda4 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Oct 2017 22:54:23 +0000 Subject: mbox: support inline filename via Content-Disposition header This is hopefully more sensical than "raw" files from resulting downloads. --- t/hval.t | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't') diff --git a/t/hval.t b/t/hval.t index a3712666..2af4d2af 100644 --- a/t/hval.t +++ b/t/hval.t @@ -32,4 +32,14 @@ EOF is($html, $exp, 'only obfuscated relevant addresses'); +is('foo-bar', PublicInbox::Hval::to_filename('foo bar '), + 'to_filename has no trailing -'); + +is('foo-bar', PublicInbox::Hval::to_filename("foo bar\nanother line\n"), + 'to_filename has no repeated -, and nothing past LF'); + +is('foo.bar', PublicInbox::Hval::to_filename("foo....bar"), + 'to_filename squeezes -'); + + done_testing(); -- cgit v1.2.3-24-ge0c7