From 5a742b8020c486a02f028c7448ee4db0068ae991 Mon Sep 17 00:00:00 2001 From: C0D3 M4513R <28912031+C0D3-M4513R@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:09:01 +0200 Subject: [PATCH] Allow reqwest to be used without `default-tls` --- Cargo.toml | 7 +++++-- generate.sh | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7cc6aa6..9ff12d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,10 @@ serde_with = { version = "^3.8", default-features = false, features = ["base64", serde_json = "^1.0" url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", features = ["json", "cookies", "multipart"] } +reqwest = { version = "^0.12", default-features = false, features = ["json", "cookies", "multipart"] } [dev-dependencies] -tokio = { version = '1', features = ['macros', 'rt-multi-thread'] } \ No newline at end of file +tokio = { version = '1', features = ['macros', 'rt-multi-thread'] } + +[features] +default = ["reqwest/default"] \ No newline at end of file diff --git a/generate.sh b/generate.sh index b11be0f..671c6e0 100755 --- a/generate.sh +++ b/generate.sh @@ -25,11 +25,15 @@ find src -type f -exec sed -i '/^\s*\/\/\/\s*$/d' {} \; # Cookie storage sed -i 's/Client::new()/Client::builder().cookie_store(true).build().unwrap()/g' src/apis/configuration.rs -sed -i 's/features = \["json", "multipart"\]/features = \["json", "cookies", "multipart"\]/g' Cargo.toml +sed -i 's/, features = \["json", "multipart"\]/, default-features = false, features = \["json", "cookies", "multipart"\]/g' Cargo.toml #Fix example printf "\n[dev-dependencies]\ntokio = { version = '1', features = ['macros', 'rt-multi-thread'] }" >> Cargo.toml +#Add feature section to Cargo.toml +printf "\n[features]\ndefault = [\"reqwest/default\"]" >> Cargo.toml + + # https://github.com/vrchatapi/specification/issues/241 cat patches/2FA_Current_User.rs >> src/models/current_user.rs sed -i 's/pub use self::current_user::CurrentUser;/pub use self::current_user::{EitherUserOrTwoFactor, CurrentUser};/g' src/models/mod.rs