diff --git a/ubw-sward/src/http/random.rs b/ubw-sward/src/http/random.rs index 958c358..8274183 100644 --- a/ubw-sward/src/http/random.rs +++ b/ubw-sward/src/http/random.rs @@ -1,6 +1,7 @@ use compact_str::CompactString; use rand::seq::IteratorRandom; use regex::Regex; +use url::Url; #[derive(Clone)] pub struct RandomUrlGenerator { @@ -89,6 +90,11 @@ impl RandomUrlGenerator { }, ) } + + pub fn generate_url(&mut self) -> Result { + let url = self.generate(); + Url::parse(&url) + } } #[derive(Debug, thiserror::Error)]