]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
reject_bots: avoid download prompts in Firefox
authorEric Wong <e@80x24.org>
Tue, 2 Sep 2025 20:30:14 +0000 (20:30 +0000)
committerEric Wong <e@80x24.org>
Sat, 6 Sep 2025 18:36:09 +0000 (18:36 +0000)
Apparently, some versions of Firefox will open a download prompt
when attempting to open the page without a Content-Type.  So set
a Content-Type and keep those installations and users of Firefox
happy.

Reported-by: Leah Neukirchen <leah@vuxu.org>
Link: https://public-inbox.org/meta/878qiwriq7.fsf@vuxu.org/
contrib/RejectBots.pm

index 3bd01c8400eb53886456a97d5485452096ca5d72..81c574c06fb4f05cf4994ec824e8fa3e9f52a357 100644 (file)
@@ -31,7 +31,7 @@ sub call {
                my $body = <<EOM;
 Requiring persistent connection to access: $uri ...
 EOM
-               [ 200, [ 'Refresh' => 1,
+               [ 200, [ 'Refresh' => 1, 'Content-Type' => 'text/plain',
                        'Content-Length' => length($body) ], [ $body ] ]
        } else {
                $self->app->($env);