diff --git a/chirpstack/src/integration/http.rs b/chirpstack/src/integration/http.rs index 88b2ca4f..f19770e4 100644 --- a/chirpstack/src/integration/http.rs +++ b/chirpstack/src/integration/http.rs @@ -29,7 +29,7 @@ impl Integration { json: conf.json, endpoints: conf .event_endpoint_url - .split(' ') + .split(',') .map(|s| s.trim().to_string()) .collect(), } @@ -183,6 +183,26 @@ pub mod test { use super::*; use httpmock::prelude::*; + #[test] + fn test_url_split() { + let i = Integration::new(&HttpConfiguration { + headers: HashMap::new(), + json: true, + event_endpoint_url: "http://a.com,http://b.com, http://c.com , http://d.com" + .to_string(), + }); + + assert_eq!( + vec![ + "http://a.com".to_string(), + "http://b.com".to_string(), + "http://c.com".to_string(), + "http://d.com".to_string(), + ], + i.endpoints + ); + } + #[tokio::test] async fn test_http() { let server = MockServer::start();