Bugzilla – Attachment 155436 Details for
Bug 34745
ThingISBN broken: User agent blocked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34745: FOR TESTING - ThingISBN broken: User agent blocked
Bug-34745-FOR-TESTING---ThingISBN-broken-User-agen.patch (text/plain), 1.33 KB, created by
Owen Leonard
on 2023-09-08 14:53:58 UTC
(
hide
)
Description:
Bug 34745: FOR TESTING - ThingISBN broken: User agent blocked
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2023-09-08 14:53:58 UTC
Size:
1.33 KB
patch
obsolete
>From cc6d8acb3f21593b3f805a7e6a6ffe3732a50e8c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 8 Sep 2023 14:46:50 +0000 >Subject: [PATCH] Bug 34745: FOR TESTING - ThingISBN broken: User agent blocked > >This patch corrects the LibraryThing URL to use https instead of http >and adds a custom agent string to the initialization of LWP::UserAgent: >"Mozilla/5.0" > >This is a test to confirm that the a different user agent string might >allow the ThingISBN to work again. >--- > C4/XISBN.pm | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > >diff --git a/C4/XISBN.pm b/C4/XISBN.pm >index 67d89ea96c..476c146a00 100644 >--- a/C4/XISBN.pm >+++ b/C4/XISBN.pm >@@ -84,7 +84,7 @@ sub get_xisbns { > my ($response,$thing_response,$syndetics_response,$errors); > # THINGISBN > if ( C4::Context->preference('ThingISBN') ) { >- my $url = "http://www.librarything.com/api/thingISBN/".$isbn; >+ my $url = "https://www.librarything.com/api/thingISBN/".$isbn; > $thing_response = _get_url($url,'thingisbn'); > } > >@@ -120,8 +120,9 @@ sub get_xisbns { > sub _get_url { > my ($url,$service_type) = @_; > my $ua = LWP::UserAgent->new( >- timeout => 2 >- ); >+ timeout => 2, >+ agent => "Mozilla/5.0" >+ ); > > my $response = $ua->get($url); > if ($response->is_success) { >-- >2.30.2
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 34745
: 155436