From cd1415377b29457d3155b1a1c88e3dd7c1462a46 Mon Sep 17 00:00:00 2001 From: Alice Butcher Date: Tue, 5 Mar 2024 13:11:26 +0000 Subject: [PATCH] fix: redirect canvas links to main iiif manifest (instead of throwing an error) --- ckanext/iiif/builders/manifest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ckanext/iiif/builders/manifest.py b/ckanext/iiif/builders/manifest.py index d4347d4..ee5d584 100644 --- a/ckanext/iiif/builders/manifest.py +++ b/ckanext/iiif/builders/manifest.py @@ -38,7 +38,9 @@ def match_and_build(self, identifier: str) -> Optional[dict]: required format :raise: IIIFBuildError if anything goes wrong after the identifier is matched """ - regex = re.compile('resource/(?P.+?)/record/(?P.+)$') + regex = re.compile( + 'resource/(?P.+?)/record/(?P[^/]+).*$' + ) match = regex.match(identifier) if not match: return None