summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/rest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index 876c0a8..f233f6b 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -4802,6 +4802,7 @@ static int og_cmd_post_repository_update(json_t *element,
} else if (!strcmp(key, "name")) {
err = og_json_parse_string_copy(value, name,
sizeof(name));
+ params->flags |= OG_REST_PARAM_NAME;
} else if (!strcmp(key, "addr")) {
err = og_json_parse_clients(value, params);
}
@@ -4810,6 +4811,7 @@ static int og_cmd_post_repository_update(json_t *element,
return err;
}
if (!og_msg_params_validate(params, OG_REST_PARAM_ID |
+ OG_REST_PARAM_NAME |
OG_REST_PARAM_ADDR))
return -1;
@@ -4884,6 +4886,7 @@ static int og_cmd_post_repository_add(json_t *element,
if (!strcmp(key, "name")) {
err = og_json_parse_string_copy(value, name,
sizeof(name));
+ params->flags |= OG_REST_PARAM_NAME;
} else if (!strcmp(key, "addr")) {
err = og_json_parse_clients(value, params);
}
@@ -4892,7 +4895,8 @@ static int og_cmd_post_repository_add(json_t *element,
return err;
}
- if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR))
+ if (!og_msg_params_validate(params, OG_REST_PARAM_ADDR |
+ OG_REST_PARAM_NAME))
return -1;
dbi = og_dbi_open(&ogconfig.db);