aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-xreq.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-07-24 11:47:44 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-07-24 16:28:32 +0200
commit77ca8b40f2d0c8b1cbf9960bd5a5b2aec36fef38 (patch)
tree90a0206c748dde157460dce3524bf88f49552ed6 /src/afb-xreq.c
parente17ae412245ba9afb33ff6a0f1f665b4d66d4da4 (diff)
json-c: Remove escaping of slashs
By default json-c escapes the slashes. This is almost ugly and unuseful. But the resolution (with JSON_C_TO_STRING_NOSLASHESCAPE) was introduced lately by json-c. Integrate it as much as possible. Change-Id: Ia9c4bee78dc11df1ee9640cb04311991bd860e43 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-xreq.c')
-rw-r--r--src/afb-xreq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/afb-xreq.c b/src/afb-xreq.c
index 8f246b3c..ba6660e6 100644
--- a/src/afb-xreq.c
+++ b/src/afb-xreq.c
@@ -24,6 +24,9 @@
#include <stdarg.h>
#include <json-c/json.h>
+#if !defined(JSON_C_TO_STRING_NOSLASHESCAPE)
+#define JSON_C_TO_STRING_NOSLASHESCAPE 0
+#endif
#include <afb/afb-binding-v1.h>
#include <afb/afb-binding-v2.h>
@@ -666,7 +669,7 @@ void afb_xreq_reply_f(struct afb_xreq *xreq, struct json_object *obj, const char
const char *afb_xreq_raw(struct afb_xreq *xreq, size_t *size)
{
struct json_object *obj = xreq_json_cb(xreq_to_req_x2(xreq));
- const char *result = json_object_to_json_string(obj);
+ const char *result = json_object_to_json_string_ext(obj, JSON_C_TO_STRING_NOSLASHESCAPE);
if (size != NULL)
*size = strlen(result);
return result;