https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30614
Aleisha Amohia <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Aleisha Amohia <[email protected]> --- This script is very old, I imagine the way it's being done is a reflection of it's age. We use HTTP::Request throughout Koha now. I imagine replace that with something close to how we do this in Koha/ERM/EUsage/UsageDataProvider.pm : =head3 _handle_sushi_response Creates and sends the request based on a provided url Also handles any redirects =cut Koha/ERM/EUsage/UsageDataProvider.pm sub _handle_sushi_request { my ($url) = @_; my $request = HTTP::Request->new( 'GET' => $url ); my $ua = LWP::UserAgent->new; $ua->agent( 'Koha/' . Koha::version() ); my $response = $ua->simple_request($request); if ( $response->is_redirect ) { my $redirect_url = $response->header('Location'); $redirect_url = URI->new_abs( $redirect_url, $url ); $response = $ua->get($redirect_url); } return $response; } -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
