summaryrefslogtreecommitdiffstats
path: root/rust/src/endpoint_handlers.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-18 18:01:33 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-18 18:01:33 -0700
commit71ffc180036088d310714ca3d960b6378290a809 (patch)
tree3fef3cabb3e208575cc0e27e12920ea8d8f1fa89 /rust/src/endpoint_handlers.rs
parent11dfac5f8f9ced9b56cf277d0e3adeccc572b251 (diff)
downloadfatcat-71ffc180036088d310714ca3d960b6378290a809.tar.gz
fatcat-71ffc180036088d310714ca3d960b6378290a809.zip
rust: API lower-cases DOI lookups
Diffstat (limited to 'rust/src/endpoint_handlers.rs')
-rw-r--r--rust/src/endpoint_handlers.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/rust/src/endpoint_handlers.rs b/rust/src/endpoint_handlers.rs
index d9bd3403..f43b3559 100644
--- a/rust/src/endpoint_handlers.rs
+++ b/rust/src/endpoint_handlers.rs
@@ -277,10 +277,12 @@ impl Server {
jstor_id,
) {
(Some(doi), None, None, None, None, None, None, None) => {
- check_doi(doi)?;
+ // DOIs always stored lower-case; lookups are case-insensitive
+ let doi = doi.to_lowercase();
+ check_doi(&doi)?;
release_ident::table
.inner_join(release_rev::table)
- .filter(release_rev::doi.eq(doi))
+ .filter(release_rev::doi.eq(&doi))
.filter(release_ident::is_live.eq(true))
.filter(release_ident::redirect_id.is_null())
.first(conn)?