mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-29 12:06:01 +02:00
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:
@@ -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")
|
||||
|
||||
@@ -18,7 +18,7 @@ const COMMANDS: &[&str] = &[
|
||||
"list_channels",
|
||||
"delete_channel",
|
||||
"create_channel",
|
||||
"permission_state"
|
||||
"permission_state",
|
||||
];
|
||||
|
||||
fn main() {
|
||||
|
||||
Reference in New Issue
Block a user