Changed parameters and arguments.

This commit is contained in:
Jose Marcial Vieira Bisneto 2017-09-22 11:52:31 -03:00
parent d872fb079d
commit 0b45b25d6e
No known key found for this signature in database
GPG key ID: 103E935E7E6E831E

View file

@ -362,16 +362,18 @@ struct HttpRequest* api_build_http_request(struct s_request* req) {
} }
value = strchr(name, '='); 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(); struct HttpParam *hp = ipfs_core_http_param_new();
if (hp) { if (hp) {
*value++ = '\0';
hp->name = name; hp->name = name;
hp->value = value; hp->value = value; // maybe null ?
libp2p_utils_vector_add(request->params, hp); libp2p_utils_vector_add(request->params, hp);
} }
} else { // without =, assuming arguments
libp2p_utils_vector_add(request->arguments, name);
} }
} }
} }