mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-09 12:36:07 +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")
|
||||
|
||||
Reference in New Issue
Block a user