mirror of
https://github.com/opus-tango/http-server-in-c.git
synced 2026-03-20 03:55:25 +00:00
fix string and pointer bugs to actually send 404
This commit is contained in:
@@ -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, ": ");
|
||||
|
||||
Reference in New Issue
Block a user