From 8cd6b4350441225b43fd5428ccaa3e7dbe6d9883 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 11 Jun 2024 11:30:22 +0100 Subject: [PATCH] Bug 37040: (RMaint follow-up) Restore passing CSRF error This patch restores the plack.middleware.Koha.CSRF plack env setting to allow passing to the errorDocument. Signed-off-by: Martin Renvoize --- Koha/Middleware/CSRF.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Middleware/CSRF.pm b/Koha/Middleware/CSRF.pm index 5d4216e5f08..88f7035c25a 100644 --- a/Koha/Middleware/CSRF.pm +++ b/Koha/Middleware/CSRF.pm @@ -82,6 +82,7 @@ sub call { #NOTE: Other Middleware will take care of logging to correct place, as Koha::Logger doesn't know where to go here warn $error; + $env->{'plack.middleware.Koha.CSRF'} = $error if !$env->{'plack.middleware.Koha.CSRF'}; my $res = Plack::Response->new( 403, [ 'Content-Type' => 'text/plain' ], ["Wrong CSRF token"] ); return $res->finalize; } -- 2.45.2