diff options
| author | spl3g <spleefer6@yandex.ru> | 2025-03-22 18:06:45 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2025-03-22 18:07:17 +0300 |
| commit | ad26c5cbb30bc1f5ed4f90909bc366953ae08b9f (patch) | |
| tree | 8e3a52e3160f0abede00c34d21f8610196c03710 | |
| parent | 3d11df423b83226047bd997f2de7bca5b0694846 (diff) | |
Replace const strings with char* in http_handle_path
| -rw-r--r-- | lib/http.c | 6 | ||||
| -rw-r--r-- | lib/http.h | 2 |
2 files changed, 4 insertions, 4 deletions
@@ -233,10 +233,10 @@ int init_server(arena *arena, http_server *serv, char *addr, char *port) { return 0; } -http_handler *http_handle_path(http_server *serv, const_string method, const_string path, http_handler_func handler) { +http_handler *http_handle_path(http_server *serv, char* method, char* path, http_handler_func handler) { http_handler hand = { - .method = method, - .path = path, + .method = cs_from_cstr(method), + .path = cs_from_cstr(path), .func = handler, }; @@ -168,7 +168,7 @@ void http_send_body(http_request req, const_string body); int init_server(arena *arena, http_server *serv, char *addr, char *port); int listen_and_serve(http_server *serv); -http_handler *http_handle_path(http_server *serv, const_string method, const_string path, http_handler_func handler); +http_handler *http_handle_path(http_server *serv, char *method, char *path, http_handler_func handler); void http_run_next(http_middleware *self, http_request req); void http_register_global_middleware(http_server *hand, http_middleware_func func); |
