Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collections routes need redirect #15

Closed
hadro opened this issue Sep 14, 2023 · 3 comments · Fixed by #22
Closed

Collections routes need redirect #15

hadro opened this issue Sep 14, 2023 · 3 comments · Fixed by #22
Assignees
Labels
bug Something isn't working

Comments

@hadro
Copy link
Collaborator

hadro commented Sep 14, 2023

As identified on the IIIF Slack following the IIIF/IA community call, we're missing a redirect route for collections manifest generation to match the routing we do for regular manifest generation.

I believe the following additions to app.py should cover it, but I welcome review by others:

@app.route('/iiif/<identifier>/collection.json')
@cache.cached(timeout=cache_timeouts["long"], forced_update=cache_bust)
def collection(identifier):
    return redirect(f'/iiif/3/{identifier}/collection.json', code=302)

@app.route('/iiif/<identifier>/<page>/collection.json')
@cache.cached(timeout=cache_timeouts["long"], forced_update=cache_bust)
def collectionPage(identifier, page):
    return redirect(f'/iiif/3/{identifier}/{page}/collection.json', code=302)
@hadro hadro added the bug Something isn't working label Sep 14, 2023
@glenrobson
Copy link
Collaborator

Enhancement:

Add check if metadata type="collection" then redirect to collection.json as a helper in case someone has asked for a manifest.json for a colleciton .

@digitaldogsbody
Copy link
Collaborator

I've added the redirects - but I will discuss it at the call this evening, as we don't actually do a redirect for the manifests, just serve the version with /3/ from the unversioned endpoint

@digitaldogsbody
Copy link
Collaborator

Also added the redirect from manifest.json -> collection.json when appropriate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants