MCPcopy Create free account
hub / github.com/LeenHawk/sgproxy / parse_query_value

Function parse_query_value

src/oauth.rs:547–560  ·  view source on GitHub ↗
(raw: Option<&str>, key: &str)

Source from the content-addressed store, hash-verified

545}
546
547fn parse_query_value(raw: Option<&str>, key: &str) -> Option<String> {
548 let raw = raw?.trim();
549 let query = raw
550 .split_once('?')
551 .map(|(_, query)| query)
552 .unwrap_or(raw)
553 .trim_start_matches('?');
554 for (name, value) in form_urlencoded::parse(query.as_bytes()) {
555 if name == key {
556 return Some(value.into_owned());
557 }
558 }
559 None
560}
561
562fn extract_value_from_text(raw: &str, key: &str) -> Option<String> {
563 parse_query_value(Some(raw), key)

Callers 1

extract_value_from_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected