mirror of
https://github.com/agersant/polaris
synced 2024-11-22 14:13:02 +00:00
Fixed a bug where blank DDNS url turned into '/'
This commit is contained in:
parent
524e072e9f
commit
7a84cc0290
2 changed files with 7 additions and 4 deletions
|
@ -254,11 +254,13 @@ mod test {
|
|||
use super::*;
|
||||
|
||||
#[tokio::test]
|
||||
async fn blank_config_is_valid() {
|
||||
async fn blank_config_round_trip() {
|
||||
let config_path = PathBuf::from_iter(["test-data", "blank.toml"]);
|
||||
Manager::new(&config_path, auth::Secret([0; 32]))
|
||||
let manager = Manager::new(&config_path, auth::Secret([0; 32]))
|
||||
.await
|
||||
.unwrap();
|
||||
let config: storage::Config = manager.config.read().await.clone().into();
|
||||
assert_eq!(config, storage::Config::default());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
@ -111,8 +111,9 @@ async fn get_settings(
|
|||
ddns_update_url: config_manager
|
||||
.get_ddns_update_url()
|
||||
.await
|
||||
.unwrap_or_default()
|
||||
.to_string(),
|
||||
.as_ref()
|
||||
.map(http::Uri::to_string)
|
||||
.unwrap_or_default(),
|
||||
};
|
||||
Ok(Json(settings))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue