Skip to content

Commit 1466cef

Browse files
committed
1. remove debug code, 2. keep \status api has same resposne format
1 parent 533b28e commit 1466cef

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

client/src/api.rs

-5
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ impl API {
7575

7676
pub async fn get_domain_info(&self, domain: Option<String>) -> anyhow::Result<Vec<DomainInfo>> {
7777
let param = GetDomainOption { domain };
78-
let req = self.async_client.get(self.url("status")).query(&param);
79-
let resp = req.send().await?;
80-
println!("{:?}",resp.text().await);
81-
82-
8378
let req = self.async_client.get(self.url("status")).query(&param);
8479
let resp = req.send().await?;
8580
json_resp!(resp, Vec<DomainInfo>)

server/src/admin_server.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ pub mod service {
188188
GetDomainOption, GetDomainPositionFormat, GetDomainPositionOption,
189189
UpdateUploadingStatusOption, UploadFileOption,
190190
};
191-
use crate::domain_storage::{DomainStorage, URI_REGEX};
191+
use crate::domain_storage::{DomainInfo, DomainStorage, URI_REGEX};
192192
use crate::{AdminConfig, HotReloadManager};
193193
use anyhow::{anyhow, Context};
194194
use bytes::Buf;
@@ -212,7 +212,7 @@ pub mod service {
212212
return if let Some(data) = domain_info.iter().find(|x| x.domain == domain) {
213213
Ok(warp::reply::json(&[data]).into_response())
214214
} else {
215-
Ok(StatusCode::NOT_FOUND.into_response())
215+
Ok(warp::reply::json::<[&DomainInfo; 0]>(&[]).into_response())
216216
}
217217
}
218218
_ => Ok(warp::reply::json(&domain_info).into_response()),

0 commit comments

Comments
 (0)