fix(connectors): apply db-rest host swap to Test connection#341
Merged
Conversation
The Deutsche Bahn connector stores the public base URL (v6.db.transport.rest) and the tool-execution path swaps it to the internal db-rest in cloud. But the 'Test connection' / health-check path used the raw stored base URL, so it hit the public (503-prone) endpoint instead of the real internal one — showing a failure for a connector that actually works. Extract the swap into a shared resolveInternalDbRestUrl util and use it in both DynamicMcpTools and ConnectorsService.testConnection. Move the unit test to the util (drop the now-obsolete dynamic-mcp-tools.spec).
| ): string { | ||
| const internal = env.DB_REST_INTERNAL_URL; | ||
| const isCloud = (env.DEPLOYMENT_MODE || '') === 'cloud'; | ||
| if (internal && isCloud && baseUrl.startsWith(PUBLIC_DB_REST)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #338/#340. The 'Test connection' / health-check path used the raw stored base URL (
v6.db.transport.rest, public, currently 503) instead of the internal db-rest the connector actually uses at runtime — so a working connector showed a failing test. Extract the swap into a sharedresolveInternalDbRestUrlutil used by bothDynamicMcpToolsandConnectorsService.testConnection.