(raw: &str)
| 23 | } |
| 24 | |
| 25 | fn 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 | |
| 38 | fn validate_host(host: &Host<&str>) -> Result<()> { |
| 39 | match host { |
no test coverage detected