diff --git a/iiif/routers/iiif.py b/iiif/routers/iiif.py index 0669cb1..7601cf4 100644 --- a/iiif/routers/iiif.py +++ b/iiif/routers/iiif.py @@ -1,6 +1,5 @@ from fastapi import APIRouter -from fastapi.responses import ORJSONResponse -from starlette.responses import FileResponse +from starlette.responses import FileResponse, JSONResponse from iiif.ops import IIIF_LEVEL, parse_params from iiif.processing import Task @@ -11,7 +10,7 @@ @router.get('/{identifier}/info.json') -async def get_image_info(identifier: str) -> ORJSONResponse: +async def get_image_info(identifier: str) -> JSONResponse: """ IIIF image info endpoint compliant with the specification: https://iiif.io/api/image/3.0/#22-image-information-request-uri-syntax. @@ -30,7 +29,7 @@ async def get_image_info(identifier: str) -> ORJSONResponse: 'cache-control': f'max-age={profile.cache_for}', 'link': f';rel="profile"' } - return ORJSONResponse(content=info_json, headers=headers) + return JSONResponse(content=info_json, headers=headers) @router.get('/{identifier}/{region}/{size}/{rotation}/{quality}.{fmt}') diff --git a/iiif/web.py b/iiif/web.py index f2bb09c..9631d59 100644 --- a/iiif/web.py +++ b/iiif/web.py @@ -4,7 +4,7 @@ from PIL import Image from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware -from fastapi.responses import ORJSONResponse +from starlette.responses import JSONResponse from iiif.routers import iiif, originals, simple from iiif.state import state @@ -35,7 +35,7 @@ async def on_shutdown(): @app.get('/status') -async def status(full: bool = False) -> ORJSONResponse: +async def status(full: bool = False) -> JSONResponse: """ Returns the status of the server along with some stats about current resource usages. \f @@ -53,7 +53,7 @@ async def status(full: bool = False) -> ORJSONResponse: for profile in state.profiles.values() } } - return ORJSONResponse(body, headers={'cache-control': 'no-store'}) + return JSONResponse(body, headers={'cache-control': 'no-store'}) # order matters here btw! diff --git a/setup.py b/setup.py index bbc7449..c2c8228 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,6 @@ 'fastapi~=0.63.0', 'humanize~=3.4.1', f'jpegtran-cffi @ {jpegtran_url}', - 'orjson~=3.5.2', 'pillow~=8.2.0', 'pyyaml~=5.4.1', 'uvicorn[standard]~=0.13.4',