Open nrenner opened 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).
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.
See #144 for polygon/line nogo support
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:
/
should not be used at it is usually used for app routing (eg. github.com/<user>/<repository>/issues
. It does not make sense here.~
sounds strange to me. It does not feel like a list items separator. Same for _
;
would be the best candidate, but maybe ,
could do the trick too?;
is also my favourite, ,
used to separate lon,lat - would like to keep distinguishing those two separators.
Keeping this open to also adjust the server request just for consistency, but no rush, as the issues with |
are fixed now.
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
andnogos
URL parameters both for hash permalink and server request.Candidates:
used in leaflet-hash
#map=4/53.17/14.59
, but as value (we use ",") not list separatorused by openstreetmap.org
see:
RFC 3986 - Appendix A. Collected ABNF for URI