Check for illegal characters in http header

This commit is contained in:
2020-12-23 18:29:38 +01:00
parent fbd9a2667f
commit 463568182d
2 changed files with 9 additions and 0 deletions

View File

@ -84,6 +84,8 @@ int client_request_handler(sock *client, int req_num) {
sprintf(err_msg, "Unable to parse header: Invalid method.");
} else if (ret == 3) {
sprintf(err_msg, "Unable to parse header: Invalid version");
} else if (ret == 4) {
sprintf(err_msg, "Unable to parse header: Header contains illegal characters");
}
res.status = http_get_status(400);
goto respond;