A link for example that I have: [[ iiif.nli.org.il/IIIFv21/FL7070748/full/300,/0/default.jpg | image ]]
The function evaluateMediafileUrl tries to request them with HEAD method and fails. So the whole tool fails to upload the images. I do it on the beta server.
Description
Related Objects
- Mentioned Here
- T337062: Archive the GWToolset extension
Event Timeline
How does it fail? What error do you get?
It's very obvious in the code when/where it does a HEAD request...
$options = [ 'method' => 'HEAD', 'followRedirects' => true, 'userAgent' => Http::userAgent() . ' ' . Constants::EXTENSION_NAME . '/' . Constants::EXTENSION_VERSION ];
$ curl -I iiif.nli.org.il/IIIFv21/FL7070748/full/300,/0/default.jpg HTTP/1.1 405 Method Not Allowed Allow: GET Content-Type: text/html;charset=utf-8 Content-Language: en Content-Length: 1053 Date: Sat, 25 Nov 2017 22:58:23 GMT Server:
It does support it... Just seemingly not for the images
$ curl -i -X OPTIONS iiif.nli.org.il/IIIFv21/FL7070748/full/300,/0/default.jpg HTTP/1.1 200 OK Allow: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, PATCH Content-Length: 0 Date: Sun, 26 Nov 2017 01:41:19 GMT Server:
It seems, 300, in this case, is requesting a dimension. And it's some sort of 404 thumb handler (that maybe doesn't cache?) like we have for Wikipedia et al.... So maybe it's badly written... Or just doesn't know what HEAD is/purposely blocked?
One would suggest someone tells them to tell their server administrator...
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405
The HTTP 405 Method Not Allowed response status code indicates that the request method is known by the server but has been disabled and cannot be used. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code.
We could make the extension work anyway.. Making the request as a fallback GET, and then stopping when we get content... But eugh