playframework / playframework/play-ws
Order of Form Parameters is not preserved (application/x-www-form-urlencoded)
Open
Nobody has claimed this yet.
triage
- Dominant language
- Scala
- Stars
- 224
- Forks
- 92
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 28
Description
Play WS Version (2.7.2 / etc)
JAVA
In StandaloneAhcWSRequest the order of Form-Parameters is not preserved:
// XXX shouldn't the encoding be same as charset?
Map<String, List<String>> stringListMap = FormUrlEncodedParser.parseAsJava(stringBody, "utf-8");
stringListMap.forEach((key, values) -> values.forEach(value -> builder.addFormParam(key, value)));
"FormUrlEncodedParser.parseAsJava" does not preserver the order, and "stringListMap" is unordered.
Contributor guide
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 in StandaloneAhcWSRequest at the FormUrlEncodedParser.parseAsJava call and trace how stringListMap is populated before builder.addFormParam is called. Verify the behavior with form parameters whose input order differs from map ordering; done means the encoded request preserves the original parameter order.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100