fix string and pointer bugs to actually send 404

This commit is contained in:
Nayan
2025-05-08 17:37:23 -04:00
parent ddf6f8812f
commit b12cfd2c17
5 changed files with 12 additions and 9 deletions

View File

@@ -144,6 +144,7 @@ char* response_to_string(http_response* res) {
char* response = (char*)malloc(total_length);
strcpy(response, res->status_line);
strcat(response, "\r\n");
for (int i = 0; i < res->num_headers; i++) {
strcat(response, res->headers[i].key);
strcat(response, ": ");