Skip to content

Unexpected URI variables handling when expanded into already existing query parameter name (UriComponentsBuilder) #34781

Closed as not planned
@christophejan

Description

@christophejan

With spring-web 6.2.5, I get the following behavior :

var uriOk = UriComponentsBuilder.fromUriString(“http://myhost?{pk1}={pv1}&{pk2}={pv2}”).buildAndExpand(“v1”, “v2”, “v3”, “v4”);
System.out.println(uriOk);

Output :

http://myhost?v1=v2&v3=v4

But :

var uriKo = UriComponentsBuilder.fromUriString(“http://myhost?{pk1}={pv1}&{pk2}={pv2}”).buildAndExpand(“v1”, “v2”, “v1”, “v4”);
System.out.println(uriKo);

Output :

http://myhost?v1=v4

I was expecting the following output for uriKo :

http://myhost?v1=v2&v1=v4

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions