Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoded '&' in view parameters does not reach 'activate' #51

Open
MaximBalaganskiy opened this issue May 7, 2019 · 7 comments
Open

Comments

@MaximBalaganskiy
Copy link

I'm submitting a bug report

  • Library Version:
    1.3.2

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    8.9.4

  • NPM Version:
    6.9.0

  • JSPM OR Webpack AND Version
    webpack 4.30.0

  • Browser:
    all

  • Language:
    all

Current behavior:
Passing a=b%26c as a view query results in {a: 'b', c: true} object

Expected/desired behavior:

  • What is the expected behavior?
    Passing a=b%26c as a view query results in {a: 'b&c'} object

  • What is the motivation / use case for changing the behavior?
    An encoded parameter value is expected to reach a view unchanged

@MaximBalaganskiy
Copy link
Author

This is happening because the latest version decodes a fragment before passing it to aurelia-path

@MaximBalaganskiy
Copy link
Author

Also related to aurelia/path#30

@davismj
Copy link
Member

davismj commented May 7, 2019

Seems like it might be a pretty difficult thing to work around. If you go set up a gist.run or codesandbox that I could use for debugging that would help me diagnose and prescribe a solution.

@MaximBalaganskiy
Copy link
Author

MaximBalaganskiy commented May 7, 2019

This worked until fragment decoding started happening in 1.3.2.
Not sure if I can pass parameters to views in a gist - it's executed in a frame...

@MaximBalaganskiy
Copy link
Author

MaximBalaganskiy commented May 7, 2019

Here is the gist forked from the issue template, but it does not use the latest of the aurelia-browser-history and & and + are parsed fine
https://gist.run/?id=0ac69daa2930333a9064242a4f9ff4ab

@salminio
Copy link

I'm hitting something similar but my character is a % sign which when decoded twice causes an internal error... Browser history is decoding it and then route recognize tries again causing a malformed error

vendor-bundle-8.5.0-1558258139.js:formatted:8422 Unhandled promise rejection URIError: URI malformed
at decodeURI ()
at e [as recognize] (vendor-bundle-8.5.0-1558258139.js:formatted:26612)
at t.e._createNavigationInstruction (vendor-bundle-8.5.0-1558258139.js:formatted:27447)
at t.loadUrl (vendor-bundle-8.5.0-1558258139.js:formatted:28323)
at t._loadUrl (vendor-bundle-8.5.0-1558258139.js:formatted:21586)
at t.navigate (vendor-bundle-8.5.0-1558258139.js:formatted:21514)
at t.e.navigate (vendor-bundle-8.5.0-1558258139.js:formatted:27261)
at e [as _navigate] (thingworx-ui-bundle-8.5.0-1558258139.js:formatted:43386)
at thingworx-ui-bundle-8.5.0-1558258139.js:formatted:43122
at vendor-bundle-8.5.0-1558258139.js:formatted:8401
at vendor-bundle-8.5.0-1558258139.js:formatted:8409
at MutationObserver.u (vendor-bundle-8.5.0-1558258139.js:formatted:5370)

@davismj
Copy link
Member

davismj commented May 20, 2019

fixed by #53

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

No branches or pull requests

3 participants