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.

URL parameters are re-encoded when aborting a transition

See original GitHub issue

If any parameter contains a URL encoded value, the value is re-encoded when the transition is aborted.

If the current URL is http://website.com/#!/accounts?PARAM= , calling transition#abort redirects to http://website.com/#!/accounts?PARAM=%25 instead of the original URL.

Checking transition#abort, it seems the call to #stringifyPath performs the double encoding when a String parameter is passed.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
LinusBorgcommented, Dec 1, 2016

Dang, totally forgot about this one. Hope I have time to push this tonight, if not it has to wait until the weekend.

0reactions
dfmelicorcommented, Jan 30, 2017

@LinusBorg We’re trying out the fix now, but encountering a different problem with encoding. Colons and slashes don’t seem to be encoded after the abort.

e.g.: Original URL, where PARAM = :

http://example.com/!#/path?PARAM=%3A

It is expected that on abort, URL remains unchanged. But the actual behavior is, the URL now becomes

http://example.com/!#/path?PARAM=:

I think the problem is with the ff. call in RouteTransition#abort

const path = this.from.path ? tryDecode(this.from.path, true) : '/'

Shouldn’t the second parameter be false?

Read more comments on GitHub >

github_iconTop Results From Across the Web

URL Encoding Path and Query Parameters
If path or query parameters contain characters that are either reserved or potentially unsafe when used in URLs, those characters must be URL...
Read more >
Why does the encoding's of a URL and the query string part ...
I was researching why my query parameters have plus + signs in it instead of %20 and why they have strings like %C3%BC...
Read more >
ui-sref initialze controller twice if url has params #1476 - GitHub
I have a TODO somewhere about aborting transitions when non-optional parameters are not provided.
Read more >
Params.paramtypedefinition - UI-Router
Typed parameter definitions control how parameter values are encoded (to the URL) and decoded (from the URL). UI-Router always provides the decoded parameter...
Read more >
URL encoding affecting Marketing Channel Processing Rule
The Marketing Channel Processing System does not decode the query string parameters in the URL. It assumes that the intended value is encoded ......
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