summaryrefslogtreecommitdiff
path: root/xs_httpd.h
diff options
context:
space:
mode:
authorgrunfink <grunfink@noreply.codeberg.org>2024-05-30 08:44:54 +0000
committergrunfink <grunfink@noreply.codeberg.org>2024-05-30 08:44:54 +0000
commitd56d4beb90f613b82ebf705a3e81a667b9601860 (patch)
tree5998501d0ea9a09f26db65e2d29fcb0927b5eee0 /xs_httpd.h
parent5bc2017ba065337dd15aa280ca0a43855b7b507b (diff)
parentaf8f1ef273e457318cb48f198e73c59e57373723 (diff)
Merge pull request 'Mastodon PATCH API for user profile updates' (#169) from louis77/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/169
Diffstat (limited to 'xs_httpd.h')
-rw-r--r--xs_httpd.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/xs_httpd.h b/xs_httpd.h
index 4195b81..d080b39 100644
--- a/xs_httpd.h
+++ b/xs_httpd.h
@@ -5,7 +5,7 @@
#define _XS_HTTPD_H
xs_dict *xs_httpd_request(FILE *f, xs_str **payload, int *p_size);
-void xs_httpd_response(FILE *f, int status, xs_dict *headers, xs_str *body, int b_size);
+void xs_httpd_response(FILE *f, int status, const char *status_text, xs_dict *headers, xs_str *body, int b_size);
#ifdef XS_IMPLEMENTATION
@@ -95,14 +95,14 @@ xs_dict *xs_httpd_request(FILE *f, xs_str **payload, int *p_size)
}
-void xs_httpd_response(FILE *f, int status, xs_dict *headers, xs_str *body, int b_size)
+void xs_httpd_response(FILE *f, int status, const char *status_text, xs_dict *headers, xs_str *body, int b_size)
/* sends an httpd response */
{
xs *proto;
const xs_str *k;
const xs_val *v;
- proto = xs_fmt("HTTP/1.1 %d %s", status, status / 100 == 2 ? "OK" : "ERROR");
+ proto = xs_fmt("HTTP/1.1 %d %s", status, status_text);
fprintf(f, "%s\r\n", proto);
int c = 0;