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

Enable Flask-CORS by default and update Cantaloupe default #42

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions iiify/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ def manifest2(identifier):
page = int(page)
try:
return ldjsonify(create_manifest(identifier, domain=domain, page=page))
except:
except Exception as excpt:
print("Exception occurred in manifest2:")
print(excpt)
abort(404)


Expand All @@ -232,7 +234,7 @@ def add_header(response):

def ldjsonify(data):
j = jsonify(data)
j.headers.set('Access-Control-Allow-Origin', '*')
# j.headers.set('Access-Control-Allow-Origin', '*')
j.mimetype = "application/ld+json"
return j

Expand Down
4 changes: 2 additions & 2 deletions iiify/configs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def getdef(self, section, option, default_value):

# Enable CORS to allow cross-domain loading of tilesets from this server
# Especially useful for SeaDragon viewers running locally
cors = bool(int(config.getdef('server', 'cors', 0)))
cors = bool(int(config.getdef('server', 'cors', 1)))

iiif_domain = config.getdef('server', 'domain', 'https://iiif.archivelab.org')
media_root = config.getdef('media', 'root', 'media')
Expand All @@ -66,7 +66,7 @@ def getdef(self, section, option, default_value):
s3secret = config.getdef('url2iiif', 's3secret', '')

# cantaloupe server
image_server = config.getdef('cantaloupe', 'url', 'https://iiif.prod.archive.org/image/iiif')
image_server = config.getdef('cantaloupe', 'url', 'https://iiif.archive.org/image/iiif')

# caching
cache_timeouts = {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_manifests_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ def test_v2_image_manifest(self):


def test_text_which_is_image(self):
resp = self.test_app.get("/iiif/2/z-2-2-18-14-9/manifest.json")
resp = self.test_app.get("/iiif/2/fbf_3chords_1_/manifest.json")

self.assertEqual(resp.status_code, 200)
Loading