summaryrefslogtreecommitdiffstats
path: root/src/afb-hreq.c
diff options
context:
space:
mode:
authorjobol <jose.bollo@iot.bzh>2018-06-18 13:10:45 +0200
committerjobol <jose.bollo@iot.bzh>2018-06-18 14:10:41 +0200
commit7bf0d9c6f807ffae6d9871c606afeccb9b478d3d (patch)
treedc9cd4cc063f14d495d5f24a5c60d6859cb13cc2 /src/afb-hreq.c
parent4521c1e7ae5371ab9d639adc617d17fb4e8ded0c (diff)
afb-hsrv: Add processing of type application/json
Makes the data posted as application/json directly available through json. The previous processing made content transmitted with the content-type application/json available as a string in the field of name "" of the returned json object. Change-Id: I11615b9b147ee4daa1b1358c2bd36fd839d8a7a9 Signed-off-by: jobol <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-hreq.c')
-rw-r--r--src/afb-hreq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/afb-hreq.c b/src/afb-hreq.c
index e5dcf642..fa16565a 100644
--- a/src/afb-hreq.c
+++ b/src/afb-hreq.c
@@ -318,6 +318,9 @@ static void req_destroy(struct afb_xreq *xreq)
if (hreq->postform != NULL)
MHD_destroy_post_processor(hreq->postform);
+ if (hreq->tokener != NULL)
+ json_tokener_free(hreq->tokener);
+
for (data = hreq->data; data; data = hreq->data) {
hreq->data = data->next;
if (data->path) {