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

iron-location's this.hash is encoded and decoded using different funcitons #124

Open
dspattison-google opened this issue Feb 13, 2019 · 1 comment

Comments

@dspattison-google
Copy link

Description

this.hash should use the same encoding and decoding functions. encodeURI and encodeURIComponent have subtle differences.

https://github.com/PolymerElements/iron-location/blob/master/iron-location.js#L88
window.decodeURIComponent(window.location.hash.slice(1));

https://github.com/PolymerElements/iron-location/blob/master/iron-location.js#L210
partiallyEncodedHash = '#' + window.encodeURI(this.hash);

encodeURI and encodeURIComponent maybe the wrong function to encode/decode the hash, but i am just advocating for using the same function... not necessarily the correct one.

@danielvanmil
Copy link

why are the fragments decoded anyway? I can't seem to use a identifier with slashes for example with a url like http://localhost#/%2Fmy%2Fpath with the use-hash-as-path option as the fragment is decoded to //my/path

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

2 participants