From 423bed9a45c9c974dc8ba8af79e4f1fc341bb423 Mon Sep 17 00:00:00 2001 From: Jacob O'Mara Date: Thu, 30 Oct 2025 11:02:35 +0000 Subject: [PATCH] Bug 17387: add pagination headers and support comma-delimited Accept headers Signed-off-by: Michaela --- Koha/REST/V1/DeletedBiblios.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Koha/REST/V1/DeletedBiblios.pm b/Koha/REST/V1/DeletedBiblios.pm index 74c62a8d6a..6e8f03d1a9 100644 --- a/Koha/REST/V1/DeletedBiblios.pm +++ b/Koha/REST/V1/DeletedBiblios.pm @@ -122,30 +122,31 @@ sub list { return try { - if ( $c->req->headers->accept =~ m/application\/json(;.*)?$/ ) { + if ( $c->req->headers->accept =~ m/application\/json([;,].*)?$/ ) { + $c->add_pagination_headers(); return $c->render( status => 200, json => $c->objects->to_api($biblios), ); - } elsif ( $c->req->headers->accept =~ m/application\/marcxml\+xml(;.*)?$/ ) { + } elsif ( $c->req->headers->accept =~ m/application\/marcxml\+xml([;,].*)?$/ ) { $c->res->headers->add( 'Content-Type', 'application/marcxml+xml' ); return $c->render( status => 200, text => $biblios->print_collection('marcxml') ); - } elsif ( $c->req->headers->accept =~ m/application\/marc-in-json(;.*)?$/ ) { + } elsif ( $c->req->headers->accept =~ m/application\/marc-in-json([;,].*)?$/ ) { $c->res->headers->add( 'Content-Type', 'application/marc-in-json' ); return $c->render( status => 200, data => $biblios->print_collection('mij') ); - } elsif ( $c->req->headers->accept =~ m/application\/marc(;.*)?$/ ) { + } elsif ( $c->req->headers->accept =~ m/application\/marc([;,].*)?$/ ) { $c->res->headers->add( 'Content-Type', 'application/marc' ); return $c->render( status => 200, text => $biblios->print_collection('marc') ); - } elsif ( $c->req->headers->accept =~ m/text\/plain(;.*)?$/ ) { + } elsif ( $c->req->headers->accept =~ m/text\/plain([;,].*)?$/ ) { return $c->render( status => 200, text => $biblios->print_collection('txt') -- 2.39.5