jamesgopsill / crossref-client

A Typescript client for the Crossref API
MIT License
7 stars 3 forks source link

Client erroneously URL-encodes slashes in DOI #1

Closed Midnighter closed 10 months ago

Midnighter commented 10 months ago

When calling the client method work with a DOI, the slashes in that DOI are URL-encoded by the client, which leads to a 404 - not found response. This seems like a mistake.

Example DOI 10.1093/nar/gkac331

Request made by client to https://api.crossref.org/works/10.1093%252Fnar%252Fgkac331.

Working request https://api.crossref.org/works/10.1093/nar/gkac331.

jamesgopsill commented 10 months ago

No problems. I have updated the code to no longer url-encode the "/" for the DOI and have added a test with your example. Everything is passing and 1.0.2 has been published to NPM.

Thanks for raising the issue.

Midnighter commented 10 months ago

Appreciate the fast response, thank you!