From 0b45b25d6ea7289ae0178c5f0c27546bcc66acf6 Mon Sep 17 00:00:00 2001 From: Jose Marcial Vieira Bisneto Date: Fri, 22 Sep 2017 11:52:31 -0300 Subject: [PATCH] Changed parameters and arguments. --- core/api.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/api.c b/core/api.c index b0cf713..5ba8c4f 100644 --- a/core/api.c +++ b/core/api.c @@ -362,16 +362,18 @@ struct HttpRequest* api_build_http_request(struct s_request* req) { } value = strchr(name, '='); - if (value) { // with = assuming params. + if (value) { + *value++ = '\0'; + } + if (value && (strcmp(name, "arg")==0)) { + libp2p_utils_vector_add(request->arguments, value); + } else { struct HttpParam *hp = ipfs_core_http_param_new(); if (hp) { - *value++ = '\0'; hp->name = name; - hp->value = value; + hp->value = value; // maybe null ? libp2p_utils_vector_add(request->params, hp); } - } else { // without =, assuming arguments - libp2p_utils_vector_add(request->arguments, name); } } }