Bug 36598: Fix CSRF header name (underscore -> hyphen)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Julian Maurice 2024-05-03 09:17:37 +02:00 committed by Lucas Gass
parent ed2873bf45
commit d4a455425c
1 changed files with 1 additions and 1 deletions

View File

@ -91,7 +91,7 @@ C<$req> must be a Mojo::Message::Request object
sub is_csrf_valid {
my ( $self, $req ) = @_;
my $csrf_token = $req->param('csrf_token') || $req->headers->header('CSRF_TOKEN');
my $csrf_token = $req->param('csrf_token') || $req->headers->header('CSRF-TOKEN');
my $cookie = $req->cookie('CGISESSID');
if ( $csrf_token && $cookie ) {
my $session_id = $cookie->value;