Aias00 opened a new issue, #6886:
URL: https://github.com/apache/shenyu/issues/6886
## Description
`routeMap.entrySet().removeIf(entry ->
entry.getKey().startsWith(normalizedPath) || entry.getKey().startsWith(uri))`
uses plain `String.startsWith`. Routes are registered as `/<path>` and
`/<path>/**`. Removing server `/foo` also removes routes for `/foobar` and
`/foobar/**` because `"/foobar/**".startsWith("/foo")` is true.
## Location
-
`shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/manager/ShenyuMcpServerManager.java:356`
## Impact
Deleting one MCP server silently breaks routing for any sibling MCP server
whose path shares a prefix.
## Suggested fix
Compare on path-segment boundaries: `entry.getKey().equals(normalizedPath)
|| entry.getKey().startsWith(normalizedPath + "/")` (and same for `uri`).
## Related existing
None.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]