From e35ec1fa8b3e9aa459680e4c2d353e7ecf248b6e Mon Sep 17 00:00:00 2001 From: Joe Wicentowski Date: Tue, 16 Jul 2024 10:37:31 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20tighten=20controller=E2=80=99s=20handlin?= =?UTF-8?q?g=20of=20API=20URLs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller.xql | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/controller.xql b/controller.xql index 3d7ed947..cae0ce6c 100644 --- a/controller.xql +++ b/controller.xql @@ -131,7 +131,7 @@ else switch($path-parts[1]) (: handle requests for static resource: robots.txt :) case "robots.txt" - case "opensearch.html" + case "opensearch.xml" case "favicon.ico" return @@ -664,7 +664,15 @@ else switch($path-parts[1]) (: handle OPDS API requests :) case 'api' return - if ($path-parts[2] eq 'v1') then + if ( + $path-parts[2] eq 'v1' + and + ( + ($path-parts[3] eq 'catalog' and empty($path-parts[4])) + or + ($path-parts[3] eq 'catalog' and $path-parts[4] = ('all', 'recent', 'browse', 'search')) + ) + ) then