* RESTCONF PUT/POST erroneously returned 200 OK. Instead restconf now returns:

* `201 Created` for created resources
  * `204 No Content` for replaced resources.
  * See [RESTCONF: HTTP return codes are not according to RFC 8040](https://github.com/clicon/clixon/issues/56)

* HTTP `Location:` fields added in RESTCONF POST replies
This commit is contained in:
Olof hagsand 2019-07-25 13:15:31 +02:00
parent 291f173505
commit c1bae276ff
27 changed files with 1734 additions and 1298 deletions

View file

@ -207,6 +207,15 @@ xml_child_spec(cxobj *x,
* @note empty value/NULL is smallest value
* @note some error cases return as -1 (qsort cant handle errors)
* @note some error cases return as -1 (qsort cant handle errors)
*
* NOTE: "comparing" x1 and x2 here judges equality from a structural (model)
* perspective, ie both have the same yang spec, if they are lists, they have the
* the same keys. NOT that the values are equal!
* In other words, if x is a leaf with the same yang spec, <x>1</x> and <x>2</x> are
* "equal".
* If x is a list element (with key "k"),
* <x><k>42</42><y>foo</y></x> and <x><k>42</42><y>bar</y></x> are equal,
* but is not equal to <x><k>71</42><y>bar</y></x>
*/
int
xml_cmp(cxobj *x1,
@ -299,10 +308,10 @@ xml_cmp(cxobj *x1,
else{
if (xml_cv_cache(x1b, &cv1) < 0) /* error case */
goto done;
assert(cv1);
// assert(cv1);
if (xml_cv_cache(x2b, &cv2) < 0) /* error case */
goto done;
assert(cv2);
// assert(cv2);
if ((equal = cv_cmp(cv1, cv2)) != 0)
goto done;
}