Skip to content

Commit ae67bd8

Browse files
author
chenkangqiang
committed
fix: card resolver
1 parent 81b4a6b commit ae67bd8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/src/main/java/io/a2a/client/A2ACardResolver.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ public A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCar
5555
public A2ACardResolver(A2AHttpClient httpClient, String baseUrl, String agentCardPath,
5656
Map<String, String> authHeaders) throws A2AClientError {
5757
this.httpClient = httpClient;
58+
if (!baseUrl.endsWith("/")) {
59+
baseUrl += "/";
60+
}
5861
agentCardPath = agentCardPath == null || agentCardPath.isEmpty() ? DEFAULT_AGENT_CARD_PATH : agentCardPath;
62+
if (agentCardPath.startsWith("/")) {
63+
agentCardPath = agentCardPath.substring(1);
64+
}
5965
try {
6066
this.url = new URI(baseUrl).resolve(agentCardPath).toString();
6167
} catch (URISyntaxException e) {

0 commit comments

Comments
 (0)