Bug 32995: Pass user agent string for OverDrive fulfillment

This patch simply adds the string Koha/VERSION to the fulfillment
request

TO test:
1 - Have OverDrive credentials for testing
2 - Enable all the overdrive options in system preferences
3 - Sign in to opac with an overdrive user and verify you can checkout
  and download titles
4 - Sign off

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Not tested with OverDrive, but change looks harmless enough.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Nick Clemens 2023-02-17 13:01:02 +00:00 committed by Tomas Cohen Arazi
parent 56f6b6b6fc
commit d27a3419cc
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -23,6 +23,7 @@ use Carp qw( croak );
use base qw(Koha::ExternalContent);
use WebService::ILS::OverDrive::Patron;
use C4::Context;
use Koha;
use LWP::UserAgent;
=head1 NAME
@ -223,6 +224,7 @@ sub checkout_download_url {
my $ua = LWP::UserAgent->new;
$ua->max_redirect(0);
$ua->agent( 'Koha/'.Koha::version() );
my $response = $ua->get(
"https://patron.api.overdrive.com/v1/patrons/me/checkouts/".$item_id."/formats/downloadredirect",
'Authorization' => "Bearer ".$self->client->access_token,