iiif-map-collections icon indicating copy to clipboard operation
iiif-map-collections copied to clipboard

Bibliothèque nationale de France (Gallica): missing CORS headers for some requests

Open sammeltassen opened this issue 2 years ago • 1 comments

Example map:

  • https://gallica.bnf.fr/ark:/12148/btv1b531700621
  • https://viewer.allmaps.org/?url=https%3A%2F%2Fannotations.allmaps.org%2Fimages%2Fe6be480e05ce83a9

From Chrome console:

Access to image at 'https://gallica.bnf.fr/iiif/ark:/12148/btv1b531700621/f2/14336,12288,1924,2048/241,/0/native.jpg' from origin 'https://viewer.allmaps.org' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

The following header is present on the response:

Access-Control-Allow-Origin: *

But perhaps not always returned? Or sometimes there's no response at all?

(Potential relation to #10 if IIPServer is used)

sammeltassen avatar Apr 24 '23 14:04 sammeltassen

Trying out the above Viewer link with Firefox.

Some images work, some return a 500 Internal Server Error, some return without CORS headers. Some examples:

  • Works fine: https://gallica.bnf.fr/iiif/ark:/12148/btv1b531700621/f2/9984,8192,256,256/256,/0/native.jpg
  • No CORS: https://gallica.bnf.fr/iiif/ark:/12148/btv1b531700621/f2/9472,7936,256,256/256,/0/native.jpg
  • 500: https://gallica.bnf.fr/iiif/ark:/12148/btv1b531700621/f2/9472,8192,256,256/256,/0/native.jpg

Can't reproduce these errors: when opening them in a browser tab, all images load fine, with the correct CORS headers. Maybe some caching issue on BNF's side.

bertspaan avatar Apr 24 '23 14:04 bertspaan