Bug 36700: Update svc to use CSRF-TOKEN

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
David Cook 2024-04-29 01:23:17 +00:00 committed by Martin Renvoize
parent e4bb59683f
commit 9dcac6dfe9
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 2 additions and 2 deletions

View file

@ -106,7 +106,7 @@ sub new {
$ua->cookie_jar({});
my $get_resp = $ua->get("$url/authentication");
my $csrf_token = $get_resp->header('X-CSRF-TOKEN');
my $csrf_token = $get_resp->header('CSRF-TOKEN');
$self->{csrf_token} = $csrf_token;
my $resp = $ua->post(

View file

@ -62,5 +62,5 @@ if ( $status eq "ok" ) {
);
$csrf_token = Koha::Token->new->generate_csrf( { session_id => scalar $sessionID } );
}
print $query->header( -type => 'text/xml', cookie => $cookie, -'X-CSRF-TOKEN' => $csrf_token );
print $query->header( -type => 'text/xml', cookie => $cookie, -'CSRF-TOKEN' => $csrf_token );
print XMLout( { status => $status }, NoAttr => 1, RootName => 'response', XMLDecl => 1 );