Skip to content

Commit f704407

Browse files
committed
fix(service): fix url prefixing for subgraphs route
1 parent 81251de commit f704407

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/service/src/service/router.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,12 @@ impl ServiceRouter {
387387
.route("/subgraphs/id/{id}", post_request_handler)
388388
.with_state(graphnode_state.clone());
389389

390-
let subgraphs_route = Router::new().nest(&url_prefix, data_routes);
390+
// If url_prefix == "/", use merge; otherwise, it's safe to nest
391+
let subgraphs_route = if url_prefix == "/" {
392+
data_routes
393+
} else {
394+
Router::new().nest(&url_prefix, data_routes)
395+
};
391396

392397
let misc_routes = Router::new()
393398
.route("/", get("Service is up and running"))

0 commit comments

Comments
 (0)