Changed parameters and arguments.
This commit is contained in:
parent
d872fb079d
commit
0b45b25d6e
1 changed files with 7 additions and 5 deletions
12
core/api.c
12
core/api.c
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue