Improved sitefiles

This commit is contained in:
Nate Choe
2022-01-22 03:55:44 -06:00
parent ad64e4ecb2
commit 55da97269b
7 changed files with 93 additions and 73 deletions

View File

@@ -29,7 +29,11 @@ static int sendConn(int fd, char *str) {
}
int sendResponse(Connection *conn, Sitefile *site) {
printf("test\n");
printf("test %d\n", site->size);
for (int i = 0; i < site->size; i++) {
printf("%s %s\n", site->content[i].path, site->content[i].arg);
}
sendConn(conn->fd, "HTTP/1.1 200 OK\r\n");
sendConn(conn->fd, "Content-Type: text/html\r\n");
sendConn(conn->fd, "Content-Length: 16\r\n");