mirror of
https://github.com/tauri-apps/tauri-plugin-http.git
synced 2026-01-31 00:45:17 +01:00
feat: allow http calls without origin header (#1941)
Committed via a GitHub action: https://github.com/tauri-apps/plugins-workspace/actions/runs/11366118662 Co-authored-by: amrbashir <amrbashir@users.noreply.github.com>
This commit is contained in:
committed by
tauri-bot
parent
fd0290a458
commit
241e0fa1d2
@@ -264,6 +264,14 @@ pub async fn fetch<R: Runtime>(
|
||||
}
|
||||
}
|
||||
|
||||
// In case empty origin is passed, remove it. Some services do not like Origin header
|
||||
// so this way we can remove it in explicit way. The default behaviour is still to set it
|
||||
if cfg!(feature = "unsafe-headers")
|
||||
&& headers.get(header::ORIGIN) == Some(&HeaderValue::from_static(""))
|
||||
{
|
||||
headers.remove(header::ORIGIN);
|
||||
};
|
||||
|
||||
if let Some(data) = data {
|
||||
request = request.body(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user