Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(cors): add in support for preview domains (#832)

Will Hutchinsonb27f98c9fcae
diff --git a/rust/cloud-storage/macro_cors/src/lib.rs b/rust/cloud-storage/macro_cors/src/lib.rs
index 54efbf321d..6e865cd6e5 100644
--- a/rust/cloud-storage/macro_cors/src/lib.rs
+++ b/rust/cloud-storage/macro_cors/src/lib.rs
@@ -44,6 +44,11 @@ fn is_allowed_origin(origin: &str) -> bool {
return true;
}
+ // Allow all preview endpoints `https://*preview.macro.com`
+ if origin.ends_with("preview.macro.com") && origin.starts_with("https://") {
+ return true;
+ }
+
// Check for localhost:3xxx pattern
if origin.starts_with("http://localhost:3")
&& origin.len() == 21