Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,15 +549,17 @@ void parse_request(http_request_t *req) {
return;
}

HAL_INFO("server", "%sNew request: (%s) %s\n"
" Received from: %s%s\n", HAL_COLOR("\x1b[32m"),
req->method, req->uri, client_ip, HAL_COLOR("\x1b[0m"));

if (req->query = strchr(req->uri, '?'))
*req->query++ = '\0';
else
req->query = NULL;

/* The query can carry passwords and keys, so it is left out of the log */
HAL_INFO("server", "%sNew request: (%s) %s%s\n"
" Received from: %s%s\n", HAL_COLOR("\x1b[32m"),
req->method, req->uri, req->query ? "?..." : "",
client_ip, HAL_COLOR("\x1b[0m"));

if (req->uri && strstr(req->uri, "..")) {
close_socket_fd(req->clntFd);
req->clntFd = -1;
Expand Down