Skip to content

Conversation

@guhyunwoo
Copy link

See #48337

  • Fix bug in RootUriTemplateHandler where rootUri was not applied for empty URI templates (""). Previously, apply() only prefixed rootUri for paths starting with /.

  • Update apply() to return rootUri when the URI template is empty, ensuring consistent behavior with RestTemplateBuilder.rootUri() in @HttpExchange methods.

  • Add unit test uriStringWhenEmptyShouldReturnRoot() in RootUriBuilderFactoryTests to verify this behavior.

These changes ensure that both empty and non-empty URI templates are handled correctly.

- Updated RootUriTemplateHandler.apply() to:
  - Prefix rootUri if uriTemplate starts with '/'
  - Return rootUri if uriTemplate is blank
- This ensures correct behavior for empty and relative paths

Signed-off-by: Hyunwoo Gu <realization0327@gmail.com>
- Added tests for RootUriTemplateHandler.apply() covering:
  - URIs starting with '/'
  - Empty string
  - Blank string
  - Absolute URLs
  - Relative paths
- Ensures apply() behaves as expected in all edge cases

Signed-off-by: Hyunwoo Gu <realization0327@gmail.com>
…oreEach Annotation

Signed-off-by: Hyunwoo Gu <realization0327@gmail.com>
@philwebb
Copy link
Member

philwebb commented Dec 1, 2025

Thanks for the PR @guhyunwoo, but given the #48337 (comment) I'm going to leave things as they are until the next minor release of Spring Boot.

@philwebb philwebb closed this Dec 1, 2025
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants