Bug 37308: Add user-agent for SUSHI outgoing requests
Signed-off-by: Belal Ahmadi <belal.ahmadi@uwl.ac.uk> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
cf315751cf
commit
8175cccca2
1 changed files with 3 additions and 0 deletions
|
@ -27,6 +27,7 @@ use Koha::Exceptions;
|
||||||
|
|
||||||
use base qw(Koha::Object);
|
use base qw(Koha::Object);
|
||||||
|
|
||||||
|
use Koha;
|
||||||
use Koha::ERM::EUsage::CounterFile;
|
use Koha::ERM::EUsage::CounterFile;
|
||||||
use Koha::ERM::EUsage::CounterFiles;
|
use Koha::ERM::EUsage::CounterFiles;
|
||||||
use Koha::ERM::EUsage::UsageTitles;
|
use Koha::ERM::EUsage::UsageTitles;
|
||||||
|
@ -176,6 +177,7 @@ sub harvest_sushi {
|
||||||
my $url = $self->_build_url_query;
|
my $url = $self->_build_url_query;
|
||||||
my $request = HTTP::Request->new( 'GET' => $url );
|
my $request = HTTP::Request->new( 'GET' => $url );
|
||||||
my $ua = LWP::UserAgent->new;
|
my $ua = LWP::UserAgent->new;
|
||||||
|
$ua->agent( 'Koha/' . Koha::version() );
|
||||||
my $response = $ua->simple_request($request);
|
my $response = $ua->simple_request($request);
|
||||||
|
|
||||||
if ( $response->code >= 400 ) {
|
if ( $response->code >= 400 ) {
|
||||||
|
@ -279,6 +281,7 @@ sub test_connection {
|
||||||
|
|
||||||
my $request = HTTP::Request->new( 'GET' => $url );
|
my $request = HTTP::Request->new( 'GET' => $url );
|
||||||
my $ua = LWP::UserAgent->new;
|
my $ua = LWP::UserAgent->new;
|
||||||
|
$ua->agent( 'Koha/' . Koha::version() );
|
||||||
my $response = $ua->simple_request($request);
|
my $response = $ua->simple_request($request);
|
||||||
|
|
||||||
if ( $response->{_rc} >= 400 ) {
|
if ( $response->{_rc} >= 400 ) {
|
||||||
|
|
Loading…
Reference in a new issue