problem to get encoded URL as a query param
See original GitHub issueI have to redirect the previous location with some logic. so I came up to pass ReturnUrl as a query param.
for eg:
- /users/edit/4?returnurl=/users/list
FlowRouter.getQueryParam('returnurl'); "/users/list"
works fine - /users/edit/4?returnurl=/users/list?page=10
FlowRouter.getQueryParam('returnurl'); "/users/list?page=10"
works fine - /users/edit/4?returnurl=/users/list?page=10&sort=new
FlowRouter.getQueryParam('returnurl'); "/users/list?page=10"
failed
so I have tried to encode the url.
- /users/edit/4?returnurl=%2Fusers%2Flist%3Fpage%3D10%26sort%3Dnew
FlowRouter.getQueryParam('returnurl'); "/users/list?page=10"
again failed
Is there a way to fix this issue?
Issue Analytics
- State:
- Created 8 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Encoding URL query parameters in Java - Stack Overflow
All the Java URI encoders that I could find only expose public methods to encode the query, fragment, path parts etc. - but...
Read more >Javascript | Encode URL Query Parameter | by Sonika - Medium
My Use case: Need to accept query string parameters in order to make GET requests. We have two alternative encodeURIcomponent() and encodeURI() ...
Read more >Peas&Carrots: The Importance Of Url Encoding Query String ...
An issue can arise when query string values contain characters that have special meanings. For instance, the & character separates different ...
Read more >Ability to disable URL encoding of Query String Parameter ...
A possible solution could be to support url encoding on class level by using an attribute.
Read more >Is URL query param Encoding default to target
The answer to your question about sending special characters is you percent encode them. If you do not, you can and will have...
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
It appears that the plus characters (+) became space characters.
+1
This is an old issue, but I recently fixed this in the flow-router-extra package, and maybe it could be applied here as well. This package from Kadira hasn’t been updated in almost 5 years, so I’m not going to bother submitting a PR for it, but here is the fix in flow-router-extra for anyone who’s interested:
https://github.com/veliovgroup/flow-router/pull/92