Bug 17392 - opac/svc/overdrive_proxy is not plack safe

This patch simply replaces the ';'  in the param passed to OverDrive
with '&'

To test:
1 - Enable overdrive (requires an account)
2 - Perform an opac search
3 - Note the number of overdrive results reported
4 - Click the link to view the actual overdrive results
5 - Note the result numbers don't match
6 - Apply patch
7 - Repeat 1-4 and note results numbers match and results are relevant
8 - Test a search with a ';' to ensure this patch isn't breaking
searches

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Katrin Fischer  <katrin.fischer@bsz-bw.de>
Verified by reading code - couldn't verify using Overdrive.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2016-10-05 13:26:09 +00:00 committed by Brendan Gallagher
parent 43418ae9f0
commit f28460bdb7

View file

@ -60,8 +60,10 @@ if ( !IsOverDriveEnabled() || !( $token = GetOverDriveToken() ) ) {
exit; exit;
} }
my $fixed_query = $query->query_string;
$fixed_query =~ tr/;/&/;
my $request = HTTP::Request::Common::GET( "https://api.overdrive.com/v1" . $query->path_info . '?' . $query->query_string ); my $request = HTTP::Request::Common::GET( "https://api.overdrive.com/v1" . $query->path_info . '?' . $fixed_query );
$request->header( Authorization => $token ); $request->header( Authorization => $token );
my $ua = LWP::UserAgent->new( "Koha " . Koha::version() ); my $ua = LWP::UserAgent->new( "Koha " . Koha::version() );