biblio.el icon indicating copy to clipboard operation
biblio.el copied to clipboard

Change DOI request to https

Open juanjosegarciaripoll opened this issue 4 years ago • 0 comments

TLDR: http://dx.doi.org produces redirections that Emacs is not always capable of following. It should be replaced with https://dx.doi.org

Motivation: I have implemented my own Mendeley-type architecture using Firefox, Biblio and Ebib, as described here http://juanjose.garciaripoll.com/blog/ebib-biblio-interface/index.html I parse either the URL or webpage for DOI's and use Biblio's doi->bibtex routines. Unfortunately, quite often the system breaks down with an empty string error.

I have traced it to the fact that http://dx.doi.org always redirects to data.crossref.org and, quite often, Emacs fails to to follow the redirection. I use synchronous versions to be able to produce a meaningful trace, but the error happens also when polling asynchronously, although in that case it is quite often reflected as a timeout error.

Example 1: successful redirection.

1 -> (biblio-url-retrieve "http://doi.org/10.1038/s41586-018-0410-x" ...)
| 2 -> (url-retrieve-synchronously "http://doi.org/10.1038/s41586-018-0410-x")
| | 3 -> (url-retrieve "http://doi.org/10.1038/s41586-018-0410-x" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "

(fn &rest IGNORED)"] nil nil nil)
| | 3 <- url-retrieve: #<buffer  *http doi.org:80*>
| 2 <- url-retrieve-synchronously: #<buffer  *http data.crossref.org:443*>
| 2 -> (biblio--extract-errors nil)
| 2 <- biblio--extract-errors: nil
1 <- biblio-url-retrieve: #<buffer *Biblio entry*>

Example 2: failed redirection

1 -> (biblio-url-retrieve "http://doi.org/10.1038/s41586-018-0410-x" ...)
| 2 -> (url-retrieve-synchronously "http://doi.org/10.1038/s41586-018-0410-x")
| | 3 -> (url-retrieve "http://doi.org/10.1038/s41586-018-0410-x" #[128 "\302\303\304p#\210\300\305\240\210\301p\240\207" [(nil) (nil) url-debug retrieval "Synchronous fetching done (%S)" t] 5 "

(fn &rest IGNORED)"] nil nil nil)
| | 3 <- url-retrieve: #<buffer  *http doi.org:80*>
| 2 <- url-retrieve-synchronously: #<buffer  *http doi.org:80*>
| 2 -> (biblio--extract-errors nil)
| 2 <- biblio--extract-errors: nil
1 <- biblio-url-retrieve: "Error while processing request: (error \"Invalid response from server: \\\"\\\"\")"

juanjosegarciaripoll avatar Apr 09 '20 13:04 juanjosegarciaripoll