cpitclaudel / biblio.el

Browse and import bibliographic references from CrossRef, DBLP, HAL, arXiv, Dissemin, and doi.org from Emacs
GNU General Public License v3.0
180 stars 14 forks source link

Change DOI request to https #33

Open juanjosegarciaripoll opened 4 years ago

juanjosegarciaripoll commented 4 years ago

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: \\\"\\\"\")"