From 78c92be14ba2b376ec254f3246f494d4b265fbad Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Fri, 1 Feb 2013 13:21:12 +0100 Subject: [PATCH] Fixes issue #577, syntax error in JSONP response --- Plugins/LocatePlugin.h | 6 +++--- Plugins/NearestPlugin.h | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Plugins/LocatePlugin.h b/Plugins/LocatePlugin.h index 39d83b345..c26e75fb6 100644 --- a/Plugins/LocatePlugin.h +++ b/Plugins/LocatePlugin.h @@ -52,12 +52,12 @@ public: //query to helpdesk _Coordinate result; - std::string JSONParameter, tmp; + std::string tmp; //json // JSONParameter = routeParameters.options.Find("jsonp"); if("" != routeParameters.jsonpParameter) { - reply.content += JSONParameter; + reply.content += routeParameters.jsonpParameter; reply.content += "("; } reply.status = http::Reply::ok; @@ -82,7 +82,7 @@ public: reply.content += ",\"transactionId\": \"OSRM Routing Engine JSON Locate (v0.3)\""; reply.content += ("}"); reply.headers.resize(3); - if("" != JSONParameter) { + if("" != routeParameters.jsonpParameter) { reply.content += ")"; reply.headers[1].name = "Content-Type"; reply.headers[1].value = "text/javascript"; diff --git a/Plugins/NearestPlugin.h b/Plugins/NearestPlugin.h index 53dc1bd51..c10230f6c 100644 --- a/Plugins/NearestPlugin.h +++ b/Plugins/NearestPlugin.h @@ -60,7 +60,6 @@ public: nodeHelpDesk->FindPhantomNodeForCoordinate(routeParameters.coordinates[0], result, routeParameters.zoomLevel); std::string tmp; - std::string JSONParameter; //json if("" != routeParameters.jsonpParameter) { @@ -93,7 +92,7 @@ public: reply.content += ",\"transactionId\":\"OSRM Routing Engine JSON Nearest (v0.3)\""; reply.content += ("}"); reply.headers.resize(3); - if("" != JSONParameter) { + if("" != routeParameters.jsonpParameter) { reply.content += ")"; reply.headers[1].name = "Content-Type"; reply.headers[1].value = "text/javascript";