Skip to content

UriComponentsBuilder does not treat a URN as opaque if it contains a slash #34588

Closed
@kula003

Description

@kula003

There is change in UriTemplate between spring-web 6.2.x and 6.1.x.

Below urn template we are looking at urn:text:service-{region}:{prefix}/{id}

public void Test(){
    final UriTemplate URN_TEMPLATE = new UriTemplate("urn:text:service-{region}:{prefix}/{id}");
    System.out.println(URN_TEMPLATE.expand("US","prefix1", "Id-2").toString());
  }

Output in 6.1.x version

urn:text:service-US:prefix1/Id-2

Output in 6.2.x version

urn:/text:service-US:prefix1/Id-2

Additional slash is added post urn:

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions