Bug 27281: DBRev 20.12.00.038
[koha-ffzg.git] / errors / 400.pl
index d16f22b..2e9324d 100755 (executable)
@@ -21,6 +21,7 @@ use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Output;
 use C4::Context;
+use List::MoreUtils qw(any);
 
 my $query = CGI->new;
 my $admin = C4::Context->preference('KohaAdminEmailAddress');
@@ -37,4 +38,8 @@ $template->param (
     admin => $admin,
     errno => 400,
 );
-output_with_http_headers $query, $cookie, $template->output, 'html', '400 Bad Request';
+my $status = '400 Bad Request';
+if ( any { /(^psgi\.|^plack\.)/i } keys %ENV ) {
+    $status = '200 OK';
+}
+output_with_http_headers $query, $cookie, $template->output, 'html', $status;