initial virtual hosts support

This commit is contained in:
2025-08-09 19:43:21 +02:00
parent 0a1e36ccc8
commit 7dd0be9afc
6 changed files with 67 additions and 27 deletions

View File

@@ -48,6 +48,9 @@ cws_http *cws_http_parse(mcl_string *request_str, int sockfd, cws_config *config
}
request->sockfd = sockfd;
/* Prepare the virtual_host struct */
cws_virtual_host vhost;
char *request_str_cpy = strdup(mcl_string_cstr(request_str));
if (!request_str_cpy) {
free(request);
@@ -89,7 +92,7 @@ cws_http *cws_http_parse(mcl_string *request_str, int sockfd, cws_config *config
}
// CWS_LOG_DEBUG("location: %s", pch);
mcl_string_append(request->location, pch);
mcl_string_append(request->location_path, config->www);
// TODO: mcl_string_append(request->location_path, config->www);
/* Adjust location path */
if (strcmp(mcl_string_cstr(request->location), "/") == 0) {