nrenner / brouter-web

Web client for BRouter, a routing engine based on OpenStreetMap
https://brouter.de/brouter-web/
MIT License
364 stars 71 forks source link

Replace pipe "|" character in (backend) URLs #109

Open nrenner opened 6 years ago

nrenner commented 6 years ago

The pipe "|" is not a valid URI character (taken from an old CycleStreets URI scheme without checking). It is used as a separator in lonlats and nogos URL parameters both for hash permalink and server request.

Candidates:

see:

ntruchsess commented 6 years ago

since https://github.com/abrensch/brouter/commit/77ee79bdc3ae86b08ae96ee3f5702ce6d629239f brouter does apply standard URL-decoding to the whole query-string. So pipe-character might not be 'human readable' when being encoded, but such request is not for human eyes anyway. Being encoded does increase the payload by a few bytes though. In fact as the list of lon-lats is being used as a single query-parameter whose content is then tokenized into the array you shouldn't take any of the reserved delimiter-chars to separate lon-lat array members as most query-string building frameworks would apply url-encoding to these characters as well (because it's forbidden to use a not url-encoded reserved character within a query-parameter). My recommendation therefore is - as long you stick with get-request and long query-string - to leave it as it is and if you really want to change it take one of the 'unreserved' range. Otherwise I'd recommend you should e.g. use a post-request and put the payload e.g. json-encoded into the request body (where no such encoding-restrictions apply).

ntruchsess commented 6 years ago

BTW: have you seen my contribution to brouter, the support of open and closed polylines as nogo-areas? Currently one can use this using QMapshack. I'm working on a new Android-app with full support for it. Would be nice to see this in brouter-web as well.

nrenner commented 5 years ago

See #144 for polygon/line nogo support

bagage commented 5 years ago

I'd like brouter-web to replace the pipe | character with anything else. Apart of being non standard, it breaks URL recognition on various applications (eg. when you share a brouter link to a chat app, or email, or…).

In my opinion:

nrenner commented 5 years ago

; is also my favourite, , used to separate lon,lat - would like to keep distinguishing those two separators.

nrenner commented 5 years ago

Keeping this open to also adjust the server request just for consistency, but no rush, as the issues with | are fixed now.