Skip to content

Commit 5a0cdd8

Browse files
neckarosclaude
andcommitted
add silent 404 for deprecated socket.io endpoint
Old clients still calling /socket.io/ will get 404 without logging errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6ffe4ad commit 5a0cdd8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ async fn app() -> Result<Router> {
164164
.nest("/backups", routes::backups::routes(mc.clone()))
165165
.nest("/plugins", routes::plugins::routes(mc.clone()))
166166
.nest("/sse", routes::sse::routes(mc.clone()))
167+
.route("/socket.io/", axum::routing::any(socket_io_fallback))
167168
.fallback(fallback)
168169
.layer(middleware::from_fn(mw_range::mw_range))
169170
//.layer(middleware::map_response(main_response_mapper))
@@ -183,6 +184,11 @@ async fn fallback(uri: Uri) -> (StatusCode, &'static str) {
183184
log_info(LogServiceType::Other, format!("Route not found: {}", uri));
184185
(StatusCode::NOT_FOUND, "Not Found")
185186
}
187+
188+
/// Silent 404 for deprecated socket.io endpoint (old clients still call it)
189+
async fn socket_io_fallback() -> StatusCode {
190+
StatusCode::NOT_FOUND
191+
}
186192
struct RegisterInfo {
187193
cert_paths: Option<(PathBuf, PathBuf)>,
188194
ips: Option<ServerIpInfo>

0 commit comments

Comments
 (0)