spring-projects / spring-projects/spring-hateoas
HalLinkDiscoverer doesn't decode '+' in a param of GET request
Open
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 476
- PR merge metrics
- No merged PRs in 30d
Description
Sample code:
Map<String, Object> params = new HashMap<>();
params.put("name", name);
HalLinkDiscoverer linkDiscoverer = new HalLinkDiscoverer();
Link link = linkDiscoverer.findLinkWithRel(IS_NAME_TAKEN_REL, getSearchLinks()).expand(params);
In a debug session I see the results as follows:
- http://localhost:8080/server/api/search/isNameTaken?name=777%20777;rel="isNameTaken" for "777 777"
Space becomes "%20" which is in line with RFC https://www.w3schools.com/tags/ref_urlencode.asp - http://localhost:8080/server/api/search/isNameTaken?name=777+777;rel="isNameTaken" for "777+777"
- is supposed to become "%2B"
Tested against version 0.24.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with HalLinkDiscoverer and the Link.expand(params) entry point, tracing how GET query parameters are encoded. Reproduce the two examples from the issue and verify that a literal plus is encoded distinctly from a space while the existing link expansion behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100