mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-04-26 13:59:46 +00:00
Fix incorrect splitting of multiple http integration endpoints.
Closes #62.
This commit is contained in:
parent
bfcff17f34
commit
9fe8ee2474
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user