Bugzilla – Attachment 56016 Details for
Bug 17392
opac/svc/overdrive_proxy is not plack safe
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17392: Make svc/overdrive_proxy plack safe
Bug-17392-Make-svcoverdriveproxy-plack-safe.patch (text/plain), 1.45 KB, created by
Jonathan Druart
on 2016-10-04 10:16:23 UTC
(
hide
)
Description:
Bug 17392: Make svc/overdrive_proxy plack safe
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-04 10:16:23 UTC
Size:
1.45 KB
patch
obsolete
>From e1be20f6fc7755282a840cc0ce59fbd84395d03a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Oct 2016 11:15:16 +0100 >Subject: [PATCH] Bug 17392: Make svc/overdrive_proxy plack safe > >--- > opac/svc/overdrive_proxy | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > >diff --git a/opac/svc/overdrive_proxy b/opac/svc/overdrive_proxy >index fdddbbb..0a8097c 100755 >--- a/opac/svc/overdrive_proxy >+++ b/opac/svc/overdrive_proxy >@@ -35,7 +35,7 @@ JS side from having to deal with cross-origin/authentication issues. > use strict; > use warnings; > >-use CGI qw(-oldstyle_urls -utf8); >+use CGI qw( -utf8); > use JSON; > > use C4::Context; >@@ -46,8 +46,6 @@ use Koha; > > my $query = new CGI; > >-my $token; >- > if ( !IsOverDriveEnabled() || !( $token = GetOverDriveToken() ) ) { > print $query->header( > -status => '400 Bad Request', >@@ -61,7 +59,12 @@ if ( !IsOverDriveEnabled() || !( $token = GetOverDriveToken() ) ) { > exit; > } > >-my $request = HTTP::Request::Common::GET( "https://api.overdrive.com/v1" . $query->path_info . '?' . $query->query_string ); >+my $token; >+my $q = $query->param('q'); >+my $limit = $query->param('limit'); >+my $offset = $query->param('offset'); >+ >+my $request = HTTP::Request::Common::GET( "https://api.overdrive.com/v1?q=" . $q . "&limit=" . $limit . "&offset=".$offset); > $request->header( Authorization => $token ); > > my $ua = LWP::UserAgent->new( "Koha " . Koha::version() ); >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17392
:
56016
|
56054
|
56069
|
56151