feat(http): add http plugin version in user agent sting (#1501)

* feat(http): add http plugin version in user agent sting

* Update build.rs
This commit is contained in:
Amr Bashir
2024-07-02 03:57:24 +03:00
committed by GitHub
parent 720b60400f
commit 28bc5c2e3e
3 changed files with 11 additions and 4 deletions
+3 -1
View File
@@ -19,6 +19,8 @@ use crate::{
Error, Http, Result,
};
const HTTP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"),);
struct ReqwestResponse(reqwest::Response);
type CancelableResponseResult = Result<Result<reqwest::Response>>;
@@ -221,7 +223,7 @@ pub async fn fetch<R: Runtime>(
}
if !headers.contains_key(header::USER_AGENT.as_str()) {
request = request.header(header::USER_AGENT, "tauri-plugin-http");
request = request.header(header::USER_AGENT, HTTP_USER_AGENT);
}
if cfg!(feature = "unsafe-headers")
+1 -1
View File
@@ -18,7 +18,7 @@ const COMMANDS: &[&str] = &[
"list_channels",
"delete_channel",
"create_channel",
"permission_state"
"permission_state",
];
fn main() {