update RSHttp

This commit is contained in:
xkeyC 2024-02-07 22:46:18 +08:00
parent a0dceb27d9
commit 0b475a50a0
3 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ class URLConf {
static String get gitlabLocalizationUrl => static String get gitlabLocalizationUrl =>
"$gitApiHome/SCToolBox/LocalizationData"; "$gitApiHome/SCToolBox/LocalizationData";
static String get apiRepoPath => "$gitApiHome/SCToolBox/api/raw/branch/main/"; static String get apiRepoPath => "$gitApiHome/SCToolBox/api/raw/branch/main";
static String get gitlabApiPath => "https://$gitApiHome/api/v1/"; static String get gitlabApiPath => "https://$gitApiHome/api/v1/";

View File

@ -10,7 +10,7 @@ class RSHttp {
static init() async { static init() async {
await rust_http.setDefaultHeader(headers: { await rust_http.setDefaultHeader(headers: {
"User-Agent": "User-Agent":
"SCToolBox/${AppConf.appVersion} (${AppConf.appVersionCode}) ${AppConf.isMSE ? "" : " DEV"} RSHttp" "SCToolBox/${AppConf.appVersion} (${AppConf.appVersionCode})${AppConf.isMSE ? "" : " DEV"} RSHttp"
}); });
} }

View File

@ -28,6 +28,9 @@ lazy_static! {
.connect_timeout(Duration::from_secs(10)) .connect_timeout(Duration::from_secs(10))
.timeout(Duration::from_secs(10)) .timeout(Duration::from_secs(10))
.dns_resolver(DNS_CLIENT.clone()) .dns_resolver(DNS_CLIENT.clone())
.gzip(true)
.brotli(true)
.deflate(true)
.build() .build()
.unwrap() .unwrap()
}; };