MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / parse_origin

Function parse_origin

crates/openshell-server/src/http.rs:275–282  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

273}
274
275fn parse_origin(value: &str) -> Option<Origin> {
276 if value.eq_ignore_ascii_case("null") {
277 return None;
278 }
279 let (scheme, rest) = value.split_once("://")?;
280 let authority_end = rest.find(['/', '?', '#']).unwrap_or(rest.len());
281 parse_origin_authority(scheme, &rest[..authority_end])
282}
283
284fn parse_origin_authority(scheme: &str, authority: &str) -> Option<Origin> {
285 let scheme = scheme.to_ascii_lowercase();

Calls 2

parse_origin_authorityFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected