question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

problem to get encoded URL as a query param

See original GitHub issue

I have to redirect the previous location with some logic. so I came up to pass ReturnUrl as a query param.

for eg:

  1. /users/edit/4?returnurl=/users/list FlowRouter.getQueryParam('returnurl'); "/users/list" works fine
  2. /users/edit/4?returnurl=/users/list?page=10 FlowRouter.getQueryParam('returnurl'); "/users/list?page=10" works fine
  3. /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:open
  • Created 8 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
stinghzcommented, Aug 1, 2016

It appears that the plus characters (+) became space characters.

+1

2reactions
michaelcbrookcommented, Nov 3, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found