zotero-api-rs 1.0.0

A secure, typed Rust client for the Zotero Web API v3
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Tests for upload URL validation.

#[cfg(test)]
mod tests {
    use crate::client::{ClientOptions, ZoteroClient};

    #[tokio::test]
    async fn rejects_non_https_upload_url() {
        let client = ZoteroClient::new(ClientOptions::default()).expect("client");
        let err = client
            .upload_file_binary("http://example.com/upload", "", b"a", "", None)
            .await
            .expect_err("must fail");

        assert!(format!("{err}").contains("upload URL must use https"));
    }
}