You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Double decoding of query parameters when creating Location #12354
When I open an URL with url encoded query parameters where a parameters contains a "+" symbol, the query parameter is incorrectly decoded twice and the "+" is removed from parameter value. This happens in com.vaadin.flow.router.Location#Location(java.lang.String) which calls the com.vaadin.flow.router.LocationUtil#parseQueryParameters where query string is first extracted query = new java.net.URI(location).getQuery(); - this decodes the url encoded string for the first time, the string at this point is correct and "+" symbol gets decoded from "%2B". Next the QueryParameters.fromString(query) is called which calls com.vaadin.flow.router.QueryParameters#makeQueryParamList and this decodes the string again using value = URLDecoder.decode(value, "utf-8"); - this removed the "+" symbol from the already decoded string and the parameter value is incorrect.
E.g. the encoded parameter value someValue1%2BsomeValue2 which should be decoded as someValue1+someValue2 gets decoded as someValue1 someValue2 instead which is wrong.
This issue was solved by just handling the plus sign "+" special case, but something similar happens with the "%" character.
Is it possible to solve the underlying issue (avoid double decoding) instead of handling specific character conversion issues?
Activity
fix: Do not decode + as space
fix: Do not decode + as space (#12432)
fix: Do not decode + as space (#12432)
fix: Do not decode + as space (#12432)
fix: Do not decode + as space (#12432)
fix: Do not decode + as space (#12432)
fix: Do not decode + as space (#12432) (#12466)
fix: Do not decode + as space (#12432) (#12468)
fix: Do not decode + as space (#12432) (#12465)
fix: Do not decode + as space (#12432) (#12467)
vaadin-bot commentedon Dec 7, 2021
This ticket/PR has been released with platform 14.8.0.beta1 and is also targeting the upcoming stable 14.8.0 version.
vaadin-bot commentedon Dec 7, 2021
This ticket/PR has been released with platform 14.7.8.
vaadin-bot commentedon Dec 9, 2021
This ticket/PR has been released with platform 22.0.1.
mlopezFC commentedon Jan 28, 2022
This issue was solved by just handling the plus sign "+" special case, but something similar happens with the "%" character.
Is it possible to solve the underlying issue (avoid double decoding) instead of handling specific character conversion issues?