"ACM Digital Library" translator broken with proxy
I have a proxy set up under the form https://%h.recursos.biblioteca.upc.edu/%p with hyphens translation in the hostname. Thus for https://dl.acm.org/ we get https://dl-acm-org.recursos.biblioteca.upc.edu/ but saving to Zotero fails. This works fine for other translators, e.g. with Springer Link we get https://link-springer-com.recursos.biblioteca.upc.edu/ and I have no trouble saving the reference.
It seems the proxy is applied twice when the translator fetches the bibtex export from the page, the detail is uploaded in report id D790223056, but there are some excerpts below. The url it tries to fetch is: https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
As a workaround I can save using this translator when disabling the proxy, but then I need to add the file manually since I only have access to it through the proxy.
----
connector => true, version => 5.0.24, platform => Linux x86_64, locale => en-GB, userAgent => Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0, appName => Firefox Connector, zoteroAvailable => true
=========================================================
[...]
(3)(+0003178): Proxies.properToProxy: https://dl.acm.org/citation.cfm?id=2485927 to https://dl-acm-org.recursos.biblioteca.upc.edu/citation.cfm?id=2485927
[...]
(3)(+0000001): Translate: Beginning translation with ACM Digital Library
(3)(+0000001): Translate: bibtex URL: http://dl.acm.org.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000001): Translate: resolved to http://dl.acm.org.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000000): Translate: proxified to https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000001): HTTP GET https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
It seems the proxy is applied twice when the translator fetches the bibtex export from the page, the detail is uploaded in report id D790223056, but there are some excerpts below. The url it tries to fetch is: https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
As a workaround I can save using this translator when disabling the proxy, but then I need to add the file manually since I only have access to it through the proxy.
----
connector => true, version => 5.0.24, platform => Linux x86_64, locale => en-GB, userAgent => Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0, appName => Firefox Connector, zoteroAvailable => true
=========================================================
[...]
(3)(+0003178): Proxies.properToProxy: https://dl.acm.org/citation.cfm?id=2485927 to https://dl-acm-org.recursos.biblioteca.upc.edu/citation.cfm?id=2485927
[...]
(3)(+0000001): Translate: Beginning translation with ACM Digital Library
(3)(+0000001): Translate: bibtex URL: http://dl.acm.org.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000001): Translate: resolved to http://dl.acm.org.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000000): Translate: proxified to https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
(3)(+0000001): HTTP GET https://dl-acm-org-recursos-biblioteca-upc-edu.recursos.biblioteca.upc.edu/downformats.cfm?id=2485927&parent_id=2485922&expformat=bibtex
Technical note for anyone else interested in looking at a fix: the problem is that we're not using the url the bibtex is generated from from the translator in scrape, but instead grab it from the page, where it already appears proxified (and the re-proxify it). See https://github.com/zotero/translators/blob/master/ACM Digital Library.js#L83
Thanks!