-
Notifications
You must be signed in to change notification settings - Fork 540
Open
Labels
Description
I use consul for externalized configuration. Recently playing aroung with spring boot 4.0.0-RC1 I noticed, that http requests to consul KV store uses urlencoding of key part in path. Instead of usual GET /v1/kv/config/application/?recurse it emits GET /v1/kv/config%2Fapplication%2F?recurse:
reveal full example
GET /v1/kv/config%2Fapplication%2F?recurse HTTP/1.1
Connection: Upgrade, HTTP2-Settings
Host: 127.0.0.1:8500
HTTP2-Settings: AAEAAEAAAAIAAAAAAAMAAAAAAAQBAAAAAAUAAEAAAAYABgAA
Upgrade: h2c
User-Agent: Java-http-client/25.0.1
Accept-Encoding: gzip
Accept-Encoding: deflate
X-Consul-Token: <hidden>
HTTP/1.1 200 OK
Content-Encoding: gzip
Content-Type: application/json
Vary: Accept-Encoding
X-Consul-Default-Acl-Policy: deny
X-Consul-Index: 58350324
X-Consul-Knownleader: true
X-Consul-Lastcontact: 0
X-Consul-Query-Backend: blocking-query
Date: Mon, 27 Oct 2025 14:07:36 GMT
Content-Length: 1772
[{"LockIndex":0,"Key":"config/application/data",...snipped
Currently this works, but I'm not sure that this non standard requests will work on future versions of consul. Consul http api docs have nothing about urlencoding KV paths.
This change introduced by new implementation of consul client:
Lines 65 to 67 in 68fe9e3
| @GetExchange("/v1/kv/{context}?recurse") | |
| ResponseEntity<List<GetValue>> getKVValues(@PathVariable String context, | |
| @RequestHeader(value = ACL_TOKEN_HEADER, required = false) String aclToken); |