Skip to content

Commit

Permalink
Deactivated allowedorigins security
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Sep 21, 2024
1 parent 8809e19 commit 25ecd60
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions crates/tauri-plugin-holochain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,20 @@ impl<R: Runtime> HolochainPlugin<R> {
let admin_ws = self.admin_websocket().await?;

// Allow any when the app is build in debug mode to allow normal tauri development pointing to http://localhost:1420
let allowed_origins = if tauri::is_dev() {
AllowedOrigins::Any
} else {
let mut origins: HashSet<String> = HashSet::new();
origins.insert(happ_origin(app_id));

if main_window {
origins.insert("http://tauri.localhost".into());
origins.insert("tauri://localhost".into());
}

AllowedOrigins::Origins(origins)
};
let allowed_origins =
// if tauri::is_dev() {
AllowedOrigins::Any;
// } else {
// let mut origins: HashSet<String> = HashSet::new();
// origins.insert(happ_origin(app_id));

// if main_window {
// origins.insert("http://tauri.localhost".into());
// origins.insert("tauri://localhost".into());
// }

// AllowedOrigins::Origins(origins)
// };

let app_port = admin_ws
.attach_app_interface(0, allowed_origins, Some(app_id.clone()))
Expand Down

0 comments on commit 25ecd60

Please sign in to comment.