Bugzilla – Attachment 190189 Details for
Bug 40989
t/db_dependent/OAI/Server.t fails on Debian 13
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40989: Fix OAI-PMH tests for CGI.pm 4.68+
Bug-40989-Fix-OAI-PMH-tests-for-CGIpm-468.patch (text/plain), 2.20 KB, created by
David Nind
on 2025-12-05 06:21:52 UTC
(
hide
)
Description:
Bug 40989: Fix OAI-PMH tests for CGI.pm 4.68+
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-12-05 06:21:52 UTC
Size:
2.20 KB
patch
obsolete
>From eb6442e838a2ff2cadf57051b25ddc4c525a9652 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= <tomascohen@theke.io> >Date: Thu, 4 Dec 2025 15:26:14 -0300 >Subject: [PATCH] Bug 40989: Fix OAI-PMH tests for CGI.pm 4.68+ > >CGI.pm 4.68 (shipped with Debian 13/Trixie) changed the behavior of >self_url() to include a trailing slash when there's no path component. >This causes OAI-PMH tests to fail as they expect URLs without trailing >slashes. > >This patch strips the trailing slash from both the requestURL field in >OAI responses and the baseURL field in Identify responses to maintain >compatibility across CGI.pm versions. > >Test plan: >1. Start a 'trixie' KTD: > $ KOHA_IMAGE=main-trixie ktd --proxy --name trixie up -d > $ ktd --name trixie --wait-ready 120 >2. Run the tests: > $ ktd --name trixie --shell > k$ prove t/db_dependent/OAI/Server.t >=> FAIL: Tests fail! >3. Apply this patch >5. Repeat 2 >6. Repeat 1-2 with a 'bookworm' image >=> SUCCESS: Tests pass too! >7. Sign off :-D > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/OAI/Server/Identify.pm | 1 + > Koha/OAI/Server/Repository.pm | 5 +++++ > 2 files changed, 6 insertions(+) > >diff --git a/Koha/OAI/Server/Identify.pm b/Koha/OAI/Server/Identify.pm >index cb234d376a..71383c3845 100644 >--- a/Koha/OAI/Server/Identify.pm >+++ b/Koha/OAI/Server/Identify.pm >@@ -33,6 +33,7 @@ sub new { > my $baseURL = $repository->self_url(); > $baseURL = $+{base_url} > if $baseURL =~ m/(?<base_url>.*)\?.*/; >+ $baseURL =~ s{/$}{}; # Strip trailing slash for CGI.pm 4.68+ compatibility > > my $self = $class->SUPER::new( > baseURL => $baseURL, >diff --git a/Koha/OAI/Server/Repository.pm b/Koha/OAI/Server/Repository.pm >index 82bc89efe7..b1812df6c8 100644 >--- a/Koha/OAI/Server/Repository.pm >+++ b/Koha/OAI/Server/Repository.pm >@@ -157,6 +157,11 @@ sub new { > $response = $class->new( $self, %attr ); > } > >+ # Strip trailing slash from requestURL for CGI.pm 4.68+ compatibility >+ my $url = $response->requestURL(); >+ $url =~ s{/$}{}; >+ $response->requestURL($url); >+ > $response->set_handler( XML::SAX::Writer->new( Output => *STDOUT ) ); > $response->xslt("/opac-tmpl/xslt/OAI.xslt"); > $response->generate; >-- >2.39.5
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 40989
:
190161
|
190189
|
190467