MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / parse_url

Function parse_url

src/automation/job_webhook.rs:25–36  ·  view source on GitHub ↗
(raw: &str)

Source from the content-addressed store, hash-verified

23}
24
25fn parse_url(raw: &str) -> Result<Url> {
26 let url = Url::parse(raw).map_err(|e| TraceDecayError::Config {
27 message: format!("invalid job webhook delivery url: {e}"),
28 })?;
29 if !matches!(url.scheme(), "http" | "https") {
30 return job_error("job webhook delivery url must use http:// or https://");
31 }
32 if url.host().is_none() {
33 return job_error("job webhook delivery url must include a host");
34 }
35 Ok(url)
36}
37
38fn validate_host(host: &Host<&str>) -> Result<()> {
39 match host {

Callers 2

validate_urlFunction · 0.85
post_json_urlFunction · 0.85

Calls 2

job_errorFunction · 0.70
parseFunction · 0.50

Tested by

no test coverage detected