Skip to content

Commit 7d2894e

Browse files
committed
iiif: fix proxy path generation
1 parent f1d5dc0 commit 7d2894e

File tree

1 file changed

+5
-5
lines changed
  • invenio_rdm_records/resources

1 file changed

+5
-5
lines changed

invenio_rdm_records/resources/iiif.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ def _rewrite_url(self):
357357
"""Rewrite URL.
358358
359359
Examples:
360-
- /iiif/record:12:image.png/ -> /iiif/12/__/image.png/
361-
- /iiif/record:1234:image.png/ -> /iiif/12/34_/image.png/
360+
- /iiif/record:12:image.png/ -> /iiif/12/__/_/image.png/
361+
- /iiif/record:1234:image.png/ -> /iiif/12/34/_/image.png/
362362
- /iiif/record:1234567:image.png/ -> /iiif/12/34/567_/image.png/
363363
"""
364364
uuid = resource_requestctx.view_args["uuid"]
@@ -369,9 +369,9 @@ def _rewrite_url(self):
369369
end_parts = recid_parts[2:]
370370
recid_path = "/".join(start_parts)
371371
if end_parts:
372-
recid_path += f"/{''.join(end_parts)}"
373-
if not recid_path.endswith("_"):
374-
recid_path += "_"
372+
recid_path += f"/{''.join(end_parts)}_"
373+
else:
374+
recid_path += "/_"
375375

376376
path = request.path
377377
path = path.replace(uuid, f"{recid_path}/{filename}.ptif")

0 commit comments

Comments
 (0)