Return 404 Not found error if restconf GET does not return requested instance

This commit is contained in:
Olof hagsand 2019-07-04 20:21:07 +02:00
parent a2340c265c
commit 41f7e44dec
15 changed files with 262 additions and 67 deletions

View file

@ -397,7 +397,7 @@ api_restconf(clicon_handle h,
if (netconf_access_denied_xml(&xret, "protocol", "The requested URL was unauthorized") < 0)
goto done;
if ((xerr = xpath_first(xret, "//rpc-error")) != NULL){
if (api_return_err(h, r, xerr, pretty, use_xml) < 0)
if (api_return_err(h, r, xerr, pretty, use_xml, 0) < 0)
goto done;
goto ok;
}