The implementations of afb_req_get were not the same
for HTTP and WebSocket when the argument wasn't set.
Change-Id: I2f09376f597ee75a50b06423a19823040a9352e6
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
static struct afb_arg req_get(struct afb_hreq *hreq, const char *name)
{
+ const char *value;
struct hreq_data *hdat = get_data(hreq, name, 0);
if (hdat)
return (struct afb_arg){
.value = hdat->value,
.path = hdat->path
};
-
+
+ value = MHD_lookup_connection_value(hreq->connection, MHD_GET_ARGUMENT_KIND, name);
return (struct afb_arg){
- .name = name,
- .value = MHD_lookup_connection_value(hreq->connection, MHD_GET_ARGUMENT_KIND, name),
+ .name = value == NULL ? NULL : name,
+ .value = value,
.path = NULL
};
}