commit e144b0d
default
·
2023-02-14 07:29:21 +0000 UTC
parent f832e6a
Add OK or ERROR to HTTP response.
1 files changed,
+1,
-1
+1,
-1
1@@ -265,7 +265,7 @@ void xs_httpd_response(FILE *f, int status, xs_dict *headers, xs_str *body, int
2 xs_str *k;
3 xs_val *v;
4
5- proto = xs_fmt("HTTP/1.1 %d ", status);
6+ proto = xs_fmt("HTTP/1.1 %d %s", status, status / 100 == 2 ? "OK" : "ERROR");
7 fprintf(f, "%s\r\n", proto);
8
9 p = headers;