dlcs / protagonist

MIT License
6 stars 2 forks source link

Return 400 / 404 for invalid image requests #879

Open donaldgray opened 6 days ago

donaldgray commented 6 days ago

Ticket raised after looking through logs, there are a number of requests seen in logs that are returning 500 that should return a better error message. These are down to // in the path, e.g.

/iiif-img/1/2/foo//full/800,/0/default.jpg

We should detect incorrect paths and return a 4xx status code

donaldgray commented 3 days ago

From logs, example of another request resulting in 500 (incomplete thumbs request)

/thumbs/1/2/foo/full/400

Any requests that are fixed for /thumbs/ should also be checked in /iiif-img/ and vice versa

donaldgray commented 11 hours ago

Additional example (from https://github.com/wellcomecollection/wellcomecollection.org/blob/9a806880c226d25837e4500e5da311672c16f7bb/content/webapp/components/IIIFViewer/IIIFViewerImage.tsx#L8), is when requesting info.json with ll appended, e.g. iiif-img/2/1/foo/info.jsonll.