REST API transform route returns invalid UTF-8 in the response header
Background
Users of the rcrossref client experienced some encoding issues when calling the transform route, which might be due to invalid UTF-8 in the header, more specifically author names in link node.
https://github.com/ropensci/rcrossref/issues/225
https://github.com/ropensci/rcrossref/issues/221
Observed behavior
Here's a curl output, suggesting invalid encoding in the link header (author names).
% curl -v -H "Accept: application/x-bibtex; charset=utf-8" "https://api.crossref.org/v1/works/10.5194/bg-2021-40/transform/"
* Trying 208.254.38.72...
* TCP_NODELAY set
* Connected to api.crossref.org (208.254.38.72) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: CN=*.crossref.org
* start date: Mar 13 00:00:00 2020 GMT
* expire date: May 16 12:00:00 2022 GMT
* subjectAltName: host "api.crossref.org" matched cert's "*.crossref.org"
* issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=GeoTrust RSA CA 2018
* SSL certificate verify ok.
> GET /v1/works/10.5194/bg-2021-40/transform/ HTTP/1.1
> Host: api.crossref.org
> User-Agent: curl/7.64.1
> Accept: application/x-bibtex; charset=utf-8
>
< HTTP/1.1 200 OK
< date: Thu, 04 Nov 2021 14:50:48 GMT
< content-type: application/x-bibtex
< content-length: 645
< vary: Accept
< link: <http://dx.doi.org/10.5194/bg-2021-40>; rel="canonical", <https://creativecommons.org/licenses/by/4.0/>; version="vor"; rel="license", <http://orcid.org/0000-0003-3137-0883>; title="Jens Daniel M?ller"; rel="author", <http://orcid.org/0000-0003-4007-9764>; title="Ulf Gr?we"; rel="author", <http://orcid.org/0000-0002-3555-1115>; title="Peer Fietzek"; rel="author", <http://orcid.org/0000-0002-3082-8728>; title="Marcus Bo Wallin"; rel="author", <http://orcid.org/0000-0001-7656-1881>; title="Anna Rutgersson"; rel="author", <http://orcid.org/0000-0002-7979-7176>; title="Norbert Wasmund"; rel="author", <http://orcid.org/0000-0002-0597-9989>; title="Gregor Rehder"; rel="author"
< access-control-expose-headers: Link
< access-control-allow-headers: X-Requested-With, Accept, Accept-Encoding, Accept-Charset, Accept-Language, Accept-Ranges, Cache-Control
< access-control-allow-origin: *
< server: Jetty(9.4.40.v20210413)
< x-ratelimit-limit: 50
< x-ratelimit-interval: 1s
< x-api-pool: public
< x-rate-limit-limit: 50
< x-rate-limit-interval: 1s
< permissions-policy: interest-cohort=()
< connection: close
<
@article{2021,
doi = {10.5194/bg-2021-40},
url = {https://doi.org/10.5194%2Fbg-2021-40},
year = 2021,
month = {mar},
publisher = {Copernicus {GmbH}},
author = {Jens Daniel Müller and Bernd Schneider and Ulf Gräwe and Peer Fietzek and Marcus Bo Wallin and Anna Rutgersson and Norbert Wasmund and Siegfried Krüger and Gregor Rehder},
title = {Cyanobacteria net community production in the Baltic Sea as
inferred from profiling {\&}lt$\mathsemicolon$i{\&}gt$\mathsemicolon$p{\&}lt$\mathsemicolon$/i{\&}gt$\mathsemicolon${CO}{\&}lt$\mathsemicolon$sub{\&}gt$\mathsemicolon$2{\&}lt$\mathsemicolon$/sub{\&}gt$\mathsemicolon$ measurements}
* Closing connection 0
* TLSv1.2 (OUT), TLS alert, close notify (256):
}%
Expected behavior
How urgent
Feels urgent, because R HTTP clients (crul, httr) return errors, making it impossible to use this route.
Definition of ready
-
Product owner: @ppolischuk1 -
Tech lead: @dtkaczyk -
Service:: or C:: label applied -
Definition of done updated -
Acceptance testing plan: -
Weight applied
Definition of done
-
Unit tests identified, implemented, and passing -
Code reviewed -
Available for acceptance testing via a staging URL, or otherwise -
Consider any impacts to current or future architecture/infrastructure, and update specifications and documentation as needed -
Knowledge base reviewed and updated -
Public documentation reviewed and updated -
Acceptance criteria met -
AC 1 -
AC 2
-
-
Acceptance testing passed -
Deployed to production
Notes
Edited by Patrick Polischuk