Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kula003 opened this issue Mar 13, 2025 · 2 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@kula003
Copy link

kula003 commented Mar 13, 2025

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:

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 13, 2025
@kula003
Copy link
Author

kula003 commented Mar 17, 2025

Hi team ,
Any update regarding this issue ?

@jhoeller jhoeller added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Mar 20, 2025
@rstoyanchev rstoyanchev self-assigned this Mar 21, 2025
@rstoyanchev rstoyanchev added type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 21, 2025
@rstoyanchev rstoyanchev added this to the 6.2.6 milestone Mar 21, 2025
@rstoyanchev
Copy link
Contributor

It looks like the RfcUriParser introduced in #33639 isn't fully aligned with how an opaque URI is determined.

@rstoyanchev rstoyanchev changed the title URITemplate in 6.2.x having behavioural change for URNs with slash UriComponentsBuilder does not treat a URN as opaque if it contains a slash Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants