MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / is_allowed_origin

Function is_allowed_origin

crates/opencode-server/src/server.rs:460–468  ·  view source on GitHub ↗
(origin: &str)

Source from the content-addressed store, hash-verified

458}
459
460fn is_allowed_origin(origin: &str) -> bool {
461 origin.starts_with("http://localhost:")
462 || origin.starts_with("http://127.0.0.1:")
463 || origin == "tauri://localhost"
464 || origin == "http://tauri.localhost"
465 || origin == "https://tauri.localhost"
466 || (origin.starts_with("https://") && origin.ends_with(".opencode.ai"))
467 || is_extra_allowed_origin(origin)
468}
469
470fn cors_layer() -> CorsLayer {
471 CorsLayer::new()

Callers

nothing calls this directly

Calls 1

is_extra_allowed_originFunction · 0.85

Tested by

no test coverage detected