Skip to content

Commit f7683e1

Browse files
committed
server: use "unpublished" instead of trickery for hidden endpoints
1 parent 6cd4797 commit f7683e1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

server/src/main.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ impl FileAgentQuery {
571571
#[endpoint {
572572
method = GET,
573573
path = "/file/agent",
574+
unpublished = true,
574575
}]
575576
async fn file_agent(
576577
rqctx: RequestContext<Arc<Central>>,
@@ -663,6 +664,7 @@ async fn main() -> Result<()> {
663664
ad.register(api::factory::factory_lease).api_check()?;
664665
ad.register(api::factory::factory_lease_renew).api_check()?;
665666
ad.register(api::public::public_file_download).api_check()?;
667+
ad.register(file_agent).api_check()?;
666668

667669
if let Some(s) = p.opt_str("S") {
668670
let mut f = std::fs::OpenOptions::new()
@@ -673,12 +675,6 @@ async fn main() -> Result<()> {
673675
return Ok(());
674676
}
675677

676-
/*
677-
* These should not presently appear in the OpenAPI definition, so we
678-
* register them after it is generated:
679-
*/
680-
ad.register(file_agent).api_check()?;
681-
682678
let bind_address =
683679
p.opt_str("b").as_deref().unwrap_or("127.0.0.1:9979").parse()?;
684680

0 commit comments

Comments
 (0)