mirror of
https://github.com/moghtech/komodo.git
synced 2026-10-27 16:00:36 +00:00
NOT_FOUND if server not found
This commit is contained in:
@@ -29,7 +29,7 @@ pub async fn handler(
|
||||
|
||||
let server = crate::resource::get::<Server>(&_server)
|
||||
.await
|
||||
.status_code(StatusCode::BAD_REQUEST)?;
|
||||
.status_code(StatusCode::NOT_FOUND)?;
|
||||
|
||||
if !server.config.enabled {
|
||||
return Err(anyhow!("Server is Disabled."))
|
||||
|
||||
@@ -94,8 +94,9 @@ async fn connect_websocket(
|
||||
.await
|
||||
.map_err(|e| match e {
|
||||
tungstenite::Error::Http(response) => match response.status() {
|
||||
StatusCode::BAD_REQUEST => anyhow!("400 Bad Request: Server '{connect_as}' does not exist, is disabled, or is configured to make Core → Periphery connection"),
|
||||
StatusCode::UNAUTHORIZED => anyhow!("401 Unauthorized: Only one Server connected as '{connect_as}' is allowed."),
|
||||
StatusCode::NOT_FOUND => anyhow!("404 Not Found: Server '{connect_as}' does not exist."),
|
||||
StatusCode::BAD_REQUEST => anyhow!("400 Bad Request: Server '{connect_as}' is disabled or configured to make Core → Periphery connection"),
|
||||
StatusCode::UNAUTHORIZED => anyhow!("401 Unauthorized: Only one Server connected as '{connect_as}' is allowed. Or the Core reverse proxy needs to forward host and websocket headers."),
|
||||
_ => anyhow::Error::from(tungstenite::Error::Http(response)),
|
||||
},
|
||||
e => anyhow::Error::from(e),
|
||||
|
||||
Reference in New Issue
Block a user