AmpersandJS / ampersand-router

Clientside router with fallbacks for browsers that don't support pushState. Mostly lifted from Backbone.js.
MIT License
70 stars 16 forks source link

encoded "%" gets stripped fragment in navigate call #46

Open fde31 opened 9 years ago

fde31 commented 9 years ago

I noticed a bug when dealing with encoded percent signs in urls. Take the following simple example:

store/search/<query>

with a query value of % and proper encoding this gets

store/search/%25

When i pass this as a route to the navigate function the fragment gets changed to store/search/%by the decodeURI call in the following line. Changing the URL fragment on navigation appears like a bug to me. Based on navigating around the code a bit and the comment for that function saying that the caller is responsible for proper encoding I wonder if the decodeURI call is actually necessary.

Any thoughts on that? Thanks.