impossible to restore the order of parameters after using QueryStringDecoder
See original GitHub issueExpected behavior
Order of parameters at query string doesn’t change
Actual behavior
After using such classes as QueryStringDecoder the order of query string parameters changes
if any external library uses you decoder they will have a structure that will break the order of parameters before: param1=1¶m2=2¶m1=3 after: param1=1¶m1=3¶m2=2
Is it so neccessary to use such structure to store the parameters:
Map<String, List<String>>
because it is impossible to restore the order after we put parameters into value list here(addParams method of QueryStringDecoder.class):
List<String> values = params.get(name);
if (values == null) {
values = new ArrayList<String>(1); // Often there's only 1 value.
params.put(name, values);
}
values.add(value);
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Exception in netty QueryStringDecoder is not handled by the ...
Any thoughts on this ? Looks like that when using vertx-web and query string is send with reserved characters it's unable to recover....
Read more >io.netty.handler.codec.http.QueryStringDecoder.parameters ...
parameters. method. in. io.netty.handler.codec.http.QueryStringDecoder ... FOUND); // Check the order of the parameters in the quest string. final String ...
Read more >QueryStringDecoder (Netty API Reference (4.1.85.Final))
Splits an HTTP query string into a path string and key-value parameter pairs. This decoder is for one time use only. Create a...
Read more >Example usage for io.netty.handler.codec.http ... - Java2s.com
In this page you can find the example usage for io.netty.handler.codec.http QueryStringDecoder parameters. Prototype. public Map<String, List<String>> ...
Read more >Java Examples for io.netty.handler.codec.http ... - Javatips.net
These source code samples are taken from different open source projects. ... params = queryStringDecoder.parameters(); String error = NettyHttpUtil.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you clarify what exactly is “broken”? What depends upon the order or query parameters and why can’t you use
QueryStringDecoder.uri()
for your use case?If there is no requirement to preserve order defined in any RFC your application shouldn’t depend upon a 3rd party library providing this functionality. If you want/need this behavior (and it is not defined in an RFC) I suggest you implement this behavior in your application.
I would expect a proxy should preserve the semantics of the protocol. This doesn’t necessarily mean what comes in is exactly what goes out.
I will close this issue now. If you find a spot in the HTTP related RFCs which describes the behavior you request please re-open and provide a link.