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

Function normalize_origin

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

Source from the content-addressed store, hash-verified

427 Lazy::new(|| RwLock::new(HashSet::new()));
428
429fn normalize_origin(origin: &str) -> Option<String> {
430 let trimmed = origin.trim().trim_end_matches('/');
431 if trimmed.is_empty() {
432 None
433 } else {
434 Some(trimmed.to_string())
435 }
436}
437
438pub fn set_cors_whitelist(origins: Vec<String>) {
439 let mut next = HashSet::new();

Callers 2

set_cors_whitelistFunction · 0.85
is_extra_allowed_originFunction · 0.85

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected