Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(rpc): apply auth middleware only to matched routes

Steven Enamakel01c75416e30b
diff --git a/crates/openhuman-rpc/src/server/http/mod.rs b/crates/openhuman-rpc/src/server/http/mod.rs
index bedbe682c2..213cca1ff3 100644
--- a/crates/openhuman-rpc/src/server/http/mod.rs
+++ b/crates/openhuman-rpc/src/server/http/mod.rs
@@ -85,7 +85,7 @@ pub fn build_core_http_router(socketio_enabled: bool) -> Router {
let router = router
.fallback(not_found_handler)
.layer(middleware::from_fn(http_request_log_middleware))
- .layer(middleware::from_fn(
+ .route_layer(middleware::from_fn(
crate::server::auth::rpc_auth_middleware,
));
// Socket.IO is off (`--jsonrpc-only`): answer its path before the bearer