commit bbf8fe87a63526f1026f5c8ad1c0faac32016225
parent 7fe5e29fb96a3db6b9d8da1459b7139238fc1c07
Author: Sophie <info@soophie.de>
Date: Sun, 6 Apr 2025 14:58:04 +0000
feat: Updated libhttp functions
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/libctl.h b/src/libctl.h
@@ -36,8 +36,8 @@ http_resp_t ctl_serve_page(http_req_t *request, const char *title, ctl_fn_t fn,
};
ctl_fn(&html, ctx);
http_resp_t response = http_resp_create(HTTP_STATUS_OK);
- http_header_set(&response, "Content-Type", "text/html");
- http_resp_body_set(&response, html, strlen(html));
+ http_resp_header(&response, "Content-Type", "text/html");
+ http_resp_body(&response, html, strlen(html));
free(html);
return response;
}
@@ -50,8 +50,8 @@ http_resp_t ctl_serve_component(http_req_t *request, ctl_fn_t fn, void *data) {
};
fn(&html, ctx);
http_resp_t response = http_resp_create(HTTP_STATUS_OK);
- http_header_set(&response, "Content-Type", "text/html");
- http_resp_body_set(&response, html, strlen(html));
+ http_resp_header(&response, "Content-Type", "text/html");
+ http_resp_body(&response, html, strlen(html));
free(html);
return response;
}