struct ao2_iterator i;
void *obj;
- /* TODO - if tech isn't a recognized type of endpoint, it should 404 */
-
cache = ast_endpoint_cache();
if (!cache) {
ast_ari_response_error(
}
ao2_iterator_destroy(&i);
- ast_ari_response_ok(response, ast_json_ref(json));
+ if (ast_json_array_size(json)) {
+ ast_ari_response_ok(response, ast_json_ref(json));
+ } else {
+ ast_ari_response_error(response, 404, "Not Found",
+ "No Endpoints found with tech %s", args->tech);
+ }
}
void ast_ari_endpoints_get(struct ast_variable *headers,
struct ast_ari_endpoints_get_args *args,
break;
case 500: /* Internal Server Error */
case 501: /* Not Implemented */
+ case 404: /* Endpoints not found */
is_valid = 1;
break;
default:
break;
case 500: /* Internal Server Error */
case 501: /* Not Implemented */
+ case 404: /* Endpoints not found */
is_valid = 1;
break;
default: