feat(test): add get index test
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <string.h>
|
||||
#include <tomlc17.h>
|
||||
|
||||
#include "utils/debug.h"
|
||||
|
||||
+3
-2
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user