Skip to content

Improve check to preserve case sensitivity of scheme if URI variable present #33715

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
wants to merge 1 commit into from

Conversation

quaff
Copy link
Contributor

@quaff quaff commented Oct 16, 2024

See GH-33699, Continue c261ca3

Map has no value for 'thescheme'
java.lang.IllegalArgumentException: Map has no value for 'thescheme'
	at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
	at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:436)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
	at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
	at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:364)

…RI variable

See spring-projectsGH-33699, Continue c261ca3

```
Map has no value for 'thescheme'
java.lang.IllegalArgumentException: Map has no value for 'thescheme'
	at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
	at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:436)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
	at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
	at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:364)
```
@quaff
Copy link
Contributor Author

quaff commented Oct 16, 2024

cc @rstoyanchev

@rstoyanchev rstoyanchev self-assigned this Oct 16, 2024
@rstoyanchev
Copy link
Contributor

Thanks for taking a look. I'm curious if you actually have a case with a scheme that is part literal and part variable?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 16, 2024
@quaff
Copy link
Contributor Author

quaff commented Oct 16, 2024

Thanks for taking a look. I'm curious if you actually have a case with a scheme that is part literal and part variable?

No, I found it by code review.

Copy link
Contributor

@rstoyanchev rstoyanchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think it's fine. A scheme with { is unlikely to be more useful in lowercase.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 16, 2024
@rstoyanchev rstoyanchev added this to the 6.2.0-RC2 milestone Oct 16, 2024
@rstoyanchev rstoyanchev changed the title Fix IllegalArgumentException if scheme contains but not starts with URI variable Improve check to preserve case sensitivity of scheme if URI variable present Oct 16, 2024
rstoyanchev pushed a commit that referenced this pull request Oct 16, 2024
See gh-33715

```
Map has no value for 'thescheme'
java.lang.IllegalArgumentException: Map has no value for 'thescheme'
	at org.springframework.web.util.UriComponents$MapTemplateVariables.getValue(UriComponents.java:348)
	at org.springframework.web.util.UriComponents.expandUriComponent(UriComponents.java:263)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:436)
	at org.springframework.web.util.HierarchicalUriComponents.expandInternal(HierarchicalUriComponents.java:53)
	at org.springframework.web.util.UriComponents.expand(UriComponents.java:161)
	at org.springframework.web.util.UriComponentsBuilder.buildAndExpand(UriComponentsBuilder.java:364)
```
@rstoyanchev
Copy link
Contributor

This is now merged. Please, note we don't change the author tag for a trivial change.

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: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants