Query string starts with '?' before first parameter and not '&'. See

http://en.wikipedia.org/wiki/Query_string for an explanation. Fixes
issue #121. Thanks Jochen for the reminder!
This commit is contained in:
DennisOSRM 2012-02-17 08:45:09 +01:00
parent 1744e69214
commit b897b5d0e2
2 changed files with 5 additions and 4 deletions

View File

@ -29,7 +29,8 @@
//======================
// OBJECTS
//Map
var HOST_ROUTING_URL = 'http://routingdemo.geofabrik.de/route-via/';
var HOST_ROUTING_URL = 'http://141.3.24.68:5000/viaroute';
//var HOST_ROUTING_URL = 'http://routingdemo.geofabrik.de/route-via/';
var HOST_WEBSITE = 'http://map.project-osrm.org/';//location.host
var ISCALCULATING = false;
@ -78,7 +79,7 @@ function routing(isDragRoute){
document.getElementById('information').innerHTML = '<p class="infoHL">Release mouse button to get Route Information!</p>(If no Route Summary is diplayed, press the Route!-button)';
}
script.src = HOST_ROUTING_URL + "&start="+from.lat + ',' + from.lon + '&dest=' + to.lat + ',' + to.lon;
script.src = HOST_ROUTING_URL + "?start="+from.lat + ',' + from.lon + '&dest=' + to.lat + ',' + to.lon;
for(var i = 0; i < viaPointsVector.length; i++) {
script.src += ('&via=' + viaPointsVector[i][0] + ',' + viaPointsVector[i][1]);
}

View File

@ -53,9 +53,9 @@ public:
std::string request(req.uri);
// INFO( "[r] " << request );
std::string command;
std::size_t firstAmpPosition = request.find_first_of("&");
std::size_t firstAmpPosition = request.find_first_of("?");
command = request.substr(1,firstAmpPosition-1);
// DEBUG("[debug] looking for handler for command: " << command);
DEBUG("[debug] looking for handler for command: " << command);
try {
if(pluginMap.Holds(command)) {