Allow reqwest to be used without default-tls (#23)

This commit is contained in:
C0D3 M4513R
2024-09-21 19:26:01 +02:00
committed by GitHub
parent a615f366e5
commit ab0740ae68
2 changed files with 10 additions and 3 deletions

View File

@ -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'] }
tokio = { version = '1', features = ['macros', 'rt-multi-thread'] }
[features]
default = ["reqwest/default"]

View File

@ -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