summaryrefslogtreecommitdiffstats
path: root/src/uscxml/server/HTTPServer.cpp
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-07-11 12:56:11 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-07-11 12:56:11 (GMT)
commit5fa85b7377db25a73a2208063e3167e82febe98f (patch)
tree2ea561e90cb84ff805387c377a967c076b5b99a6 /src/uscxml/server/HTTPServer.cpp
parent1a362feda9d514ee30ad8815394ce11da2bdd29a (diff)
downloaduscxml-5fa85b7377db25a73a2208063e3167e82febe98f.zip
uscxml-5fa85b7377db25a73a2208063e3167e82febe98f.tar.gz
uscxml-5fa85b7377db25a73a2208063e3167e82febe98f.tar.bz2
Reactivated REST bridge for debugger
Diffstat (limited to 'src/uscxml/server/HTTPServer.cpp')
-rw-r--r--src/uscxml/server/HTTPServer.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp
index 044cb6c..071846c 100644
--- a/src/uscxml/server/HTTPServer.cpp
+++ b/src/uscxml/server/HTTPServer.cpp
@@ -386,9 +386,14 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD
key = item.substr(0, equalPos);
value = item.substr(equalPos + 1, item.length() - (equalPos + 1));
- char* keyCStr = evhttp_decode_uri(key.c_str());
- char* valueCStr = evhttp_decode_uri(value.c_str());
- request.data.compound["content"].compound[keyCStr] = Data(valueCStr, Data::VERBATIM);
+ size_t keyCStrLen = 0;
+ size_t valueCStrLen = 0;
+ char* keyCStr = evhttp_uridecode(key.c_str(), 1, &keyCStrLen);
+ char* valueCStr = evhttp_uridecode(value.c_str(), 1, &valueCStrLen);
+ std::string decKey = std::string(keyCStr, keyCStrLen);
+ std::string decValue = std::string(valueCStr, valueCStrLen);
+
+ request.data.compound["content"].compound[decKey] = Data(decValue, Data::VERBATIM);
free(keyCStr);
free(valueCStr);
key.clear();
@@ -412,6 +417,12 @@ void HTTPServer::httpRecvReqCallback(struct evhttp_request *req, void *callbackD
request.raw = raw.str();
+#if 0
+ std::cout << "====" << std::endl;
+ std::cout << request.raw << std::endl;
+ std::cout << "====" << std::endl;
+#endif
+
// try with the handler registered for path first
bool answered = false;
if (callbackData != NULL)