You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RootRequestBuilder sends GET /%2F instead of GET / (slash path segment is percent-encoded) #799
RootRequestBuilder requests the Horizon root endpoint as GET /%2F rather than GET /. The "/" passed as a path segment is percent-encoded by OkHttp to %2F, so the outgoing request path is /%2F.
Most Horizon servers normalize /%2F to / and return 200, so this has gone unnoticed. However, servers/proxies with stricter path routing return 404 for /%2F, which causes root requests (e.g. Server.root() used during network-passphrase validation) to fail.
Where it comes from
RootRequestBuilder is constructed with "/" as a path segment:
That segment is then added in RequestBuilder.buildUri():
// src/main/java/org/stellar/sdk/requests/RequestBuilder.javaHttpUrlbuildUri() {
if (!segments.isEmpty()) {
for (Stringsegment : segments) {
uriBuilder.addPathSegment(segment); // addPathSegment("/") -> encodes to %2F
}
}
returnuriBuilder.build();
}
OkHttp's addPathSegment("/") treats "/" as a single literal segment and percent-encodes the reserved / character to %2F, producing a request path of /%2F.
A native Horizon node (tested against horizon 26.0.0) returns 200 for both / and /%2F, which is why the encoded path normally works. A stricter endpoint returns 404 only for /%2F.
Impact
When the backing RPC/Horizon endpoint stops tolerating /%2F, every RootRequestBuilder.execute() call returns 404. In our case this broke client startup paths that validate the network passphrase via the root endpoint.
Versions
Verified identical in 2.1.0, 2.2.3, and 3.0.0 (latest stable) — same RootRequestBuilder constructor (super(httpClient, serverURI, "/")) and buildUri()addPathSegment(segment) loop in all three.
Activity
overcat commentedon Jun 11, 2026
Thank you for reporting this issue, we will release v3.1.0 tomorrow to solve this problem.
overcat commentedon Jun 12, 2026
Fixed in v3.1.0