Update .gitignore to include certs/*.pem and fix redirect response formatting in server.c

This commit is contained in:
2025-10-02 11:59:58 +02:00
parent 4e33a98cc2
commit 93e93064f7
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@@ -52,3 +52,4 @@ Mkfile.old
dkms.conf
log/*
server
certs/*.pem

View File

@@ -386,7 +386,7 @@ void *handle_http_client(void *arg) {
char redirect_response[512];
snprintf(redirect_response, sizeof(redirect_response),
"HTTP/1.1 301 Moved Permanently\r\n"
"Location: https://%s%s\r\n\r\n", config.server_name, url);
"Location: https://%.255s%.255s\r\n\r\n", config.server_name, url);
send(client_socket, redirect_response, strlen(redirect_response), 0);
log_event("Redirecting to HTTPS"); // Log the redirection
close(client_socket);