pub async fn origin_guard(
request: Request,
next: Next,
) -> Result<Response, StatusCode>Expand description
Axum middleware that blocks cross-origin requests from browsers.
§Errors
Returns StatusCode::FORBIDDEN if the Origin header is present and does not match a
localhost or tauri:// origin.