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

Function is_extra_allowed_origin

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

Source from the content-addressed store, hash-verified

450}
451
452fn is_extra_allowed_origin(origin: &str) -> bool {
453 let normalized = normalize_origin(origin).unwrap_or_else(|| origin.to_string());
454 match EXTRA_CORS_WHITELIST.read() {
455 Ok(guard) => guard.contains(&normalized),
456 Err(poisoned) => poisoned.into_inner().contains(&normalized),
457 }
458}
459
460fn is_allowed_origin(origin: &str) -> bool {
461 origin.starts_with("http://localhost:")

Callers 1

is_allowed_originFunction · 0.85

Calls 3

normalize_originFunction · 0.85
readMethod · 0.80
containsMethod · 0.80

Tested by

no test coverage detected