MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / origin_matches_request_host

Function origin_matches_request_host

packages/server/src/auth.rs:247–256  ·  view source on GitHub ↗
(headers: &HeaderMap, origin: &str)

Source from the content-addressed store, hash-verified

245}
246
247fn origin_matches_request_host(headers: &HeaderMap, origin: &str) -> bool {
248 let Some(origin_authority) = origin_authority(origin) else {
249 return false;
250 };
251 headers
252 .get(header::HOST)
253 .and_then(|value| value.to_str().ok())
254 .map(normalize_authority)
255 .is_some_and(|host| host == origin_authority)
256}
257
258fn origin_authority(origin: &str) -> Option<String> {
259 let without_scheme = origin

Callers 1

Calls 2

origin_authorityFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected