* Fixed: Some native restconf error messages did not end with \r\n.

* Specifically the error when sending http request on https.
This commit is contained in:
Olof hagsand 2021-08-20 15:41:40 +02:00
parent c35ca82083
commit 6e0e45aab7

View file

@ -647,7 +647,7 @@ send_badrequest(clicon_handle h,
cprintf(cb, "HTTP/1.1 400 Bad Request\r\nConnection: close\r\n"); cprintf(cb, "HTTP/1.1 400 Bad Request\r\nConnection: close\r\n");
if (body){ if (body){
cprintf(cb, "Content-Type: %s\r\n", media); cprintf(cb, "Content-Type: %s\r\n", media);
cprintf(cb, "Content-Length: %zu\r\n", strlen(body)); cprintf(cb, "Content-Length: %zu\r\n", strlen(body)+2); /* for \r\n */
} }
else else
cprintf(cb, "Content-Length: 0\r\n"); cprintf(cb, "Content-Length: 0\r\n");