aboutsummaryrefslogtreecommitdiffstats
path: root/src/http.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.rs')
-rw-r--r--src/http.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http.rs b/src/http.rs
new file mode 100644
index 0000000..f0a609b
--- /dev/null
+++ b/src/http.rs
@@ -0,0 +1,9 @@
+use std::sync::LazyLock;
+use reqwest::Client;
+
+pub(crate) fn new() -> Client {
+ Client::builder().https_only(true).user_agent(concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"))).build().unwrap()
+}
+pub(crate) const fn lazy() -> LazyLock<Client> {
+ LazyLock::new(new)
+}