Benign crates 1,971,651 installs download unavailable

whois-rust 3.1.0

“This is a WHOIS client library for Rust, inspired by https://github.com/hjr265/node-whois”

Basename is uppercase README.mdMarkdown-style heading precedes a code fence
SHA-256fad6f4738ff5c67a77c99cb62f67aa14dbc97ededacda8a2a4d73336dc80675c

Evidence

References the Tokio async runtime namespace lines 23–29
23:22… ex;
24use serde_json::{Map, Value};
25#[cfg(feature = "tokio")]
26use tokio::io::{AsyncReadExt, AsyncWriteExt};
27use validators::models::Host;
28
29use crate::{WhoIsError, WhoIsHost, WhoIsLookupOptions, WhoIsSe …
Rust replaces matched string content lines 108–115
108:37… f().unwrap_or(DEFAULT_WHOIS_HOST_QUERY);
109
110 let mut request = query.replace("$addr", text);
111
112 if !request.ends_with("\r\n") {
113 if request.ends_with('\n') {
114 request.pop();
115 }
Connects a Rust TcpStream with timeout lines 167–172
167:21… or = None;
168
169 for socket_addr in socket_addrs {
170 match TcpStream::connect_timeout(socket_addr, deadline.remaining()?) {
171 Ok(client) => return Ok(client),
172 Err(error) => last_error = Some(e …
Rust TcpStream::connect call lines 224–231
224:32… out(
225 deadline.remaining()?,
226 tokio::net::TcpStream::connect(socket_addr),
227 )
228 .await
229 {
230 Ok(Ok(client)) => return Ok(client),
231 Ok(Err(error)) => …
#[cfg(test)] attribute lines 757–776
757:28… query_result, tld_hint(&options.target.0).as_deref()))
758 }
759}
760
761#[cfg(test)]
762mod tests {
763 use validators::models::Host;
764
765 use super::{build_request, decode_response, extract_referral_host, tld_hint};
766 use crate::WhoIsServerValue;
767
768 #[test]
769 fn extract_referral_host_trims_trailing_cr() {
770 let body = b"Domain: example.com\r\nReferralServer: whois://whois.arin.net\r\n";
⋯6 lines

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.