kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 195 forks source link

Support for special characters in FlowRouter #599

Open TimoRuetten opened 8 years ago

TimoRuetten commented 8 years ago

We try to add a special character to our app while using FlowRouter - but it seems to be a problem.

Like GoogleMaps its doing we want to add a @-sign in our ULR when having directly LatLng data in it. Example:

app.io/location/@Lat,Lng

Sadly the FlowRouter is always encoding our @ to %40 in our url which looks very ugly. Is there a way to prevent this encoding ?

sahanDissanayake commented 8 years ago

Same issue here

Tried to set the following but the url comes out encoded

FlowRouter.setQueryParams({view: 'そししきききちち'})

But when the value is retrieved value comes out as expected

FlowRouter.getQueryParam('view'); // そししきききちち

Maybe the issue is here @arunoda ? @TimoRuetten https://github.com/kadirahq/flow-router/blob/56c5e7e8d025affd41d8532524470fe9737fa189/client/router.js#L164

TimoRuetten commented 8 years ago

@sahanDissanayake Yes thats the. The params or query object will have the values not encoded but the url params and queries will be always encoded. It would be nice to prevent this.

TimoRuetten commented 8 years ago

Hey @arunoda - is there any way that you will fix this or do we have to do a custom solution for this ?

TimoRuetten commented 8 years ago

It seems that the problem is not the FlowRouter - its the path-to-regex instead. When using the SSR router the params will not be encoded by kadira if I see it correctly. The problem is the compile() method by path-to-regex package. This is relay sad

nicooprat commented 7 years ago

Ended at the same conclusion as @TimoRuetten: https://github.com/pillarjs/path-to-regexp/issues/42.

Any news or workaround for this? I just need to have commas in URLs (eg. for GPS coordinates).