feat(test): add get index test

This commit is contained in:
2026-03-12 01:11:28 +01:00
parent 5283750095
commit b747124b9c
5 changed files with 75 additions and 8 deletions
-1
View File
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <tomlc17.h>
#include "utils/debug.h"
+3 -2
View File
@@ -35,8 +35,9 @@ static cws_vhost_s *get_vhost(cws_config_s *config, char *host) {
}
}
/* This should not happen */
return NULL;
/* Return first domain */
/* TODO: return default domain */
return &config->virtual_hosts[0];
}
static cws_return worker_handle_client_data(int epfd, int client_fd, cws_config_s *config) {
+1
View File
@@ -5,6 +5,7 @@
#include <sys/stat.h>
/* Sanitize and resolve file path */
/* TODO: fix path traversal */
static string_s *resolve_file_path(const char *url_path, cws_handler_config_s *config) {
string_s *full_path = string_new(config->root, 256);