fix(handler): print path before free

This commit is contained in:
2026-01-14 02:23:16 +01:00
parent f195bf4202
commit 0c3044d389
2 changed files with 4 additions and 5 deletions

View File

@@ -50,9 +50,8 @@ cws_response_s *cws_handler_static_file(cws_request_s *request, cws_handler_conf
}
cws_response_set_body_file(response, path);
string_free(filepath);
CWS_LOG_DEBUG("Serving file: %s (%zu bytes)", path, response->content_length);
string_free(filepath);
return response;
}

View File

@@ -52,7 +52,7 @@ static bool parse_method(cws_request_s *req, char **cursor) {
}
s[len] = '\0';
CWS_LOG_DEBUG("method: %s", s);
CWS_LOG_DEBUG("Method: %s", s);
req->method = http_parse_method(s);
*cursor = s + len + 1;
@@ -67,7 +67,7 @@ static bool parse_location(cws_request_s *req, char **cursor) {
}
s[len] = '\0';
CWS_LOG_DEBUG("location: %s", s);
CWS_LOG_DEBUG("Location: %s", s);
string_append(req->path, s);
*cursor = s + len + 1;
@@ -82,7 +82,7 @@ static bool parse_version(cws_request_s *req, char **cursor) {
}
s[len] = '\0';
CWS_LOG_DEBUG("version: %s", s);
CWS_LOG_DEBUG("Version: %s", s);
string_append(req->http_version, s);
*cursor = s + len + 1;