Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@schmitch
Copy link
Contributor

Fixes

Fixes #6551
Fixes #6549

@gmethvin @wsargent This is a Backport of QueryStringDecoder which I proposed here:
netty/netty#5820

This needs a backport against 2.5.x
After this we can also merge: #6543

I will delay scala-uri WIP for master since I got some questions after working with it the last couple of days.

@cchantep
Copy link
Member

Added some comments

@gmethvin gmethvin merged commit 6612308 into playframework:master Sep 14, 2016
@gmethvin
Copy link
Member

Thanks @schmitch

gmethvin pushed a commit that referenced this pull request Sep 14, 2016
* fixes some problems with query strings

* javadoc fix
@mkurz mkurz added this to the 2.5.8 milestone Sep 14, 2016
@alexdupre
Copy link
Contributor

This bug and related fix deserve an immediate 2.5.8 release.

@gmethvin
Copy link
Member

@alexdupre It's out now.

@alexdupre
Copy link
Contributor

I found another regression. If the query string contains eg. "key=1,2,3" and the commas are not PCT-encoded, the request.getQueryString("key") returns just "1" instead of "1,2,3", as in "key=1&key=2&key=3" scenario. The comma is so parsed as a value delimiter, is it intended?

@alexdupre
Copy link
Contributor

I don't think it's intended, because "key=1;2;3" that uses another sub-delim allowed character is parsed as a single query param of value "1" :-(

@schmitch
Copy link
Contributor Author

schmitch commented Sep 15, 2016

@alexdupre that is intended. getQueryString("key") will get the first item of the query strings. even if you have &filter=1&filter=2 it would return 1 (and that happened to be there for a while) on getQueryString("filter") at the moment we only treat , as value delimiters. (I regret the change already, wasn't worth anybodies time).

But if you want to add more you could probably add yourself to the discussion in: netty/netty#5820


We may change it so that getQueryString("filter") will return a List<String> in 2.6.x, but at the moment the query parsing and how it will work is WIP in 2.6.x

@schmitch schmitch deleted the query-string-fixes branch September 15, 2016 09:37
@arnbak
Copy link

arnbak commented Sep 15, 2016

I'm using bindFromRequest in some of my controllers, to handle params serialized with Angulars httpParamSerializer. The uri is something like query=item1,item2,item3
From 2.5.7 (its happens in 2.5.8 too), this results in only the first item of the query being parsed. I guess this relates to what @alexdupre is saying too. But if I use the queryString.get("query"), "item1,item2,item3" is returned.

I would expect the binding to work though, or is this changed from now on?

@alexdupre
Copy link
Contributor

I don't know how is your Form, you should probably change the field from text to list(text) or something like that.

@arnbak
Copy link

arnbak commented Sep 16, 2016

Changing it to a list does not help. Probably makes sense to, since its just a value for the parameter, that happens to be comma separated.

I don't know if this a bug, and I should create a separate issue for it.
Or I need to change my code, either way, it started after the 2.5.7 upgrade. And have the same behavior in version 2.5.8.

Its seems to me as, a somewhat big breaking change, for a minor update?

@schmitch
Copy link
Contributor Author

@arnbak yeah I've didn't seen a lot of edge cases, I created a PR that reverts it: #6560

wsargent pushed a commit to wsargent/playframework that referenced this pull request Oct 25, 2016
* fixes some problems with query strings

* javadoc fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants