From d27a3419cce0da8c90d3f57d54d6cf669001f210 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 17 Feb 2023 13:01:02 +0000 Subject: [PATCH] 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 Not tested with OverDrive, but change looks harmless enough. Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- Koha/ExternalContent/OverDrive.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Koha/ExternalContent/OverDrive.pm b/Koha/ExternalContent/OverDrive.pm index 6c6ccf1ae8..bf355a2d4a 100644 --- a/Koha/ExternalContent/OverDrive.pm +++ b/Koha/ExternalContent/OverDrive.pm @@ -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, -- 2.39.5