translators
translators copied to clipboard
handle HTTP status code 300 in unAPI
In my current implementation of unAPI endpoint (which will change soon because of this bug, sorry), URLs with IDs and no format such as https://ldspdi.bdrc.io/UNAPI?id=bdr:MW22084 return a HTTP 300 status code, as recommended in the spec:
unAPI defers to the response status codes already defined in HTTP [RFC 2616] to indicate the success or failure of an operation. In particular, it is recommended that unAPI implementors utilize the following:
- 300 Multiple Choices for the UNAPI?id=IDENTIFIER function
But the unAPI translator doesn't work and the debug output says:
Error: HTTP request to https://ldspdi.bdrc.io/UNAPI?id=bdr:MW22084 rejected with status 300 messaging_inject.js:79:17
I think it shouldn't consider 300 as an error automatically.
Thanks for reporting. We can have it treat 300 as a success. Could you link me to a page that's currently failing?
well, unfortunately I can't anymore as I've changed our server... but I can hack something
If returning status 300 is consistent with the spec, then please keep doing it! I can just push an update for the translator.
here's a page that uses an unAPI endpoint that returns a 300: https://eroux.fr/testunapi300.html I'm still getting the error message but...! contrary to my previous assumption, Zotero seems to work and finds what it's supposed to find... so I guess something must have been off in my earlier testing sorry! In any case, it's probably best not to consider a 300 an error, at least in that case