-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Dynamic route segments aren't URL-encoded #4794
Comments
I think https://github.com/emberjs/ember.js/pull/3396/files needs to be reapplied without the feature flag as it looks like it got chucked |
Also possibly needs updating to test and support HashLocation too if that's still got a problem? |
@machty I think we talked about this at some point |
@machty ping. |
1 similar comment
@machty ping. |
Any news on this? |
Got also hit by this one. I think Ember should handle this as I'm now supposed to encode and decode each potentially "dangerous" dynamic segment I'm using by hand. I don't see a reason why the user should care about this - should work out-of-box. |
I updated the provided JSBin to current canary setup: http://rwjblue.jsbin.com/dusuti/edit?html,js The reported issue of clicking on "Encoded" and being transitioned into "Raw" after a refresh remains. |
I haven't dug in to be certain yet, but it looks like this may have been fixed in 2.7? |
It seems so. Closing this as fixed, though I think there is a related issue :( |
I've read through #3263 and the associated PR (#3545), and while it looks like everybody involved agreed that URL encoding should 'just work', it doesn't look like that's where things ultimately landed.
Those issues were closed in favor of rolling in a fix that was part of @alexspeller's query params work, but unfortunately it appears URL encoding is only handled for query parameters, not dynamic route segments.
As a quick example of where things can go wrong, take a look at this JS Bin example. It has two models, one with ID
'A B'
(Raw) and one with ID'A%20B'
(Encoded). If you click the link for the 'Encoded' model and then refresh the page, you'll see it loads the 'Raw' one instead.HashLocation
andHistoryLocation
both appear to have this behavior. I would expect them always to encode dynamic path segments to avoid this kind of ambiguity.The text was updated successfully, but these errors were encountered: